Solved

Using Eclipse to Create Projects from Existing Source

Posted on 2010-11-19
6
813 Views
Last Modified: 2013-12-15
Hello,

I am new to Eclipse and have been having a really hard time trying to create a project from an existing source. I read through answers to similar questions but nothing has worked for me so far. Thank you in advance for taking a look at my problem and I apologize if the matter's trivial.


I am trying to create a project from the source code contained in the folder:

C:\Users\Babylon\Documents\BNs\JavaBayes\JavaBayes-0.346\Source\BayesianNetworks

However, BayesianNetworks is only one of the folders I am interested in. The complete package/folder structure is attached in the first image (e.g. InterchangFormat, JavaBayesInterface, etc...). All the packages (given as subdirectories of Source) import the packages they require.

Now, to create a new project from BayesianNetworks, this is what I did:

1- Set my workspace as:
C:\Users\Babylon\Documents\BNs\JavaBayes\JavaBayes-0.346\Source

2- File - New - Java Project. In the dialog box, I entered BayesianNetworks for project name and selected the radiobutton for creating a project from existing source with the following source specified:

C:\Users\Babylon\Documents\BNs\JavaBayes\JavaBayes-0.346\Source\BayesianNetworks

This is given in the second image attached.

In the JavaBuild settings, I left everything as is (I previous tried creating a src folder and importing all the .java files to it, but that didn't work). So my JavaBuild is just the default.


3- In the run configuration, I added:

C:\Users\Babylon\Documents\BNs\JavaBayes\JavaBayes-0.346\Source\BayesianNetworks

to the source lookup path, classpath and specified Tester.java (in the BayesianNetworks package/subdirectory) as my main class. Tester.java is a very simple java file containing nothing but a main method and is given in the third image.

4- When I attempt to run it, I get "Editor does not contain a main type" and can't execute my program (the fourth image).

Can I please know what on earth have I done wrong? I've been trying to figure this out for three hours now. I really appreciate any help I can get. Thank you again.


0
Comment
Question by:zibrahim
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
sweetfa2 earned 500 total points
ID: 34179458
You specify a number of images, but none are available.

When you right click on the project and select BuildConfiguration
do you have the source file directories defined there?

Have you tried creating the project in another directory,and then copying the source file sinto it?
0
 
LVL 12

Expert Comment

by:marklorenz
ID: 34179666
What type of project is it?  Web?  Java?  Make sure you create the right type of project if it isn't an existing Eclipse project.  If it is an Eclipse project, make sure you Import and pick Existing Eclipse project.
0
 

Author Comment

by:zibrahim
ID: 34180057
Hi again and thank you for your replies.

Sorry about the images, they're attached to this message.


 1st image 2nd image 3rd image 4th image
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:zibrahim
ID: 34180068
@sweetfa2: Yes, I added the source: C:\Users\Babylon\Documents\BNs\JavaBayes\JavaBayes-0.346\Source\BayesianNetworks to the build configuration (it wouldn't be there at first and I have to manually add it).

But no, I didn't try doing that, I will do so now and will let you know if it works, thanks.

@marklorenz: It's a java project. Also, I am merely importing the source because I don't have an eclipse project to begin with, the project I have was build using an editor and jdk. Thanks.
0
 
LVL 12

Expert Comment

by:marklorenz
ID: 34180361
The error message seems to be saying that you are trying to execute a class that does not have a main() method.  If the class is a JUnit, try running it as that.  Otherwise, Eclipse will look for the main() method (a JUnit doesn't need a main() method).
0
 

Author Comment

by:zibrahim
ID: 34180616
Thank you guys, creating a new project then copying all the files to the src folder worked. I have another question now but I will post it in a new topic.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question