Our professor gives us .class files to use for our homework because
they contain methods/classes that are needed with the other source
files he provides. The problem is that Eclipse doesn't recognize these
.class files, and makes all my other .java files show errors.
I guess what I mean by doesn't recognize is that if there is a file
that has a class named "NewClass" called NewClass.class and I import
that into my eclipse project, then when I use OtherClass.java and try
to instantiate an NewClass object, then Eclipse doesn't recognize it.
Is there a way to fix this?
Btw - command-line compilation works fine of course, but this doesn't
let me use the power of Eclipse
Thanks,
Keith
Venkatesh - 27 Apr 2006 04:51 GMT
U should put the directory or jar containing that class file into ur
project library.
These are the steps to set up ur libraries properly in eclipse:
1. Right click on the project name in Package explorer and choose
Properties.
2. In the dialog box that comes up choose Java Build Path
3. Inside java build path, choose the "Libraries" tab and add
directories(Button - Add Class Folders)/jars (Button - Add jars/Add
external jars) etc ...
I'm using Eclipse 3.1.0, but guess the same thing is applicable for all
versions of eclipse
-Venkatesh
keperry - 27 Apr 2006 13:58 GMT
Hmm...this didn't seem to change anything?
Venkatesh - 27 Apr 2006 15:48 GMT
Hi,
What is ur class file name? Is it inside a package? Where did u place
the class? Also, what path did u add in the "libraries" list.
Guess the correct path is not added, hence u r not finding things
working
-Venkatesh