GeeCON Prague 2014*
The moose likes IDEs, Version Control and other tools and the fly likes Can't Build imported classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Can Watch "Can New topic
Author

Can't Build imported classes

karen keight
Greenhorn

Joined: Apr 23, 2011
Posts: 2
Hi! I've created an Eclipse project, all its classes were already created and I only have to import them to my project, to do that I :
- right click my project and then select "Import"
- Select file system
- Browse to the .java and .class folders, they are in 3 folders (A, B, C) which i selected
- Then "finish"

Apparently this worked fine because now all the classes are in the 3 folders A, B and C folders in my "src" folder, but now when I try to Build, nothing happens and when I try to Run my main class I get the message "A in K does not exist", K is the name of my project and A is the folder where my main class is.

I tryied File/Refresh but it does not work.. seems like if my classes were not there..

Thanks
Karen
Erich Tiegelholz
Greenhorn

Joined: May 27, 2012
Posts: 10
Did you use the correct import statements for the existing classes in your new project? Do you declare the correct package for your new project? Also, are your folders marked as source folders in Eclipse? Your icons should look something like this:




[Thumbnail for Screen.png]

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39053
    
  23
Moving the the IDEs forum.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39053
    
  23
Moving the the IDEs forum.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39053
    
  23
Moving the the IDEs forum.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Are you just trying to use those classes in your project? If so, it would be easier to place them in a JAR file and add that JAR to your build path.

Of are you trying to turn that set of classes into a project? If so, what I usually do is create a blank project of the correct type, and then copy the .java source files into the project. You can copy then outside of Eclipse, and then within Eclipse simply refresh the project. Or you can copy then from your file manager into your eclipse project. Both method work well for me.


JBoss In Action
 
GeeCON Prague 2014
 
subject: Can't Build imported classes