This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hello! I am being given several .class files to work with on a coding project for school. I am attempting to integrate them into my eclipse project but am having some trouble, even after looking at other topics online.
Here is my attempted solution:
- Folder("graph", classes in here)
I right clicked on the project > properties > Java build path > Libraries Tab > Add Class Folder
Select the "graph" folder in the existing project, and the folder showed up on the list
In the code for "main", attempted:
But the path is not recognized. Is there an error in my process, or in my import call?
It's perfect what you did so far.
My doubt is that the classes you're trying to use have a different package declaration, other than "graph".
Since you're using Eclipse, try removing the import you wrote in your main class. Then, inside one of your method's body, write the name of a class you're trying to use. Next, press Ctrl+Space immediately after the class name you just wrote and Eclipse will automatically add the import for you.
As an alternative, instead of Ctrl+Space you can also try Ctrl+Shift+O (Organize imports) and the outcome should be the same.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Eclipse Problem, Incorporate existing .class into project