Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't Build imported classes

 
karen keight
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

Screen.png
Screenshot Eclipse Package Explorer
[Thumbnail for Screen.png]
 
Campbell Ritchie
Sheriff
Posts: 48363
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving the the IDEs forum.
 
Campbell Ritchie
Sheriff
Posts: 48363
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving the the IDEs forum.
 
Campbell Ritchie
Sheriff
Posts: 48363
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving the the IDEs forum.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic