File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Classpaths in Eclipse 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 "Classpaths in Eclipse" Watch "Classpaths in Eclipse" New topic

Classpaths in Eclipse

Steve Campbell
Ranch Hand

Joined: Dec 18, 2000
Posts: 41
I thought I had it figured out, but....
I have a Java program (without a package statement) which references a class which is in a package. Using NetBeans I'm able to use the code in the class (for which I don't have the source code, only a .class file).
When I try to use Eclipse, I'm having a problem using the .class file in the project. In Eclipse I added a variable (under Windows / Preferences) which pointed to the base of the package. I then added this variable into the Project (using project properties). No matter how I tweak the variable path, or try every different way, I'm unable to reference the class in the .class file. I've read through the help file many time to no avail.
Does anyone know how to do this?
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Have you tried using "Add Class Folder" in the project properties?

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Steve Campbell
Ranch Hand

Joined: Dec 18, 2000
Posts: 41
Everytime I use the "Add Class Folder" option, the "Ok" button never comes on to allow me to close the dialog box. I'll look further into this option if this is the correct way to do this.
When I click on "Add Class Folder", it show mw the 2 projects I've created with this tool, one of them being the project to which I want to add the path to the class. Since the .class file is along another path, I then clicked the "Create New Folder", then "Advanced", then I checked the "Link to folder in the file system" checkbox, and bring the folder.
I was typing in the above commands, and now it's working.
Thanks for you help,
I agree. Here's the link:
subject: Classpaths in Eclipse
It's not a secret anymore!