Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Eclipse question - using class files in a project with out source .java

Thread view: 
keperry - 27 Apr 2006 04:28 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.