How do I use a Java .class file in Eclipse?
I have a homework assignment that requires us to use functions in a provided .class file. I'm trying to add it in Eclipse, but I'm not having any luck.
The .class file is not part of a package, and I am not submitting it with my .java files. This means I cannot开发者_运维百科 change the directory of the .class file, it needs to be in the same directory with all my .java files. I don't think I can add an external class folder with these requirements. Adding the file to a .jar is also out of the question.
How can I get my java code to recognize the methods in the .class file?
You need to add the class folder where your .class file is located. To do that go to the Project Properties -> Java Build Path -> Add Class Folder
精彩评论