File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Classpaths in Eclipse" Watch "Classpaths in Eclipse" New topic
Author

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?
Thanks,
Steve
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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,
Steve
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Classpaths in Eclipse