Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Setting CLASSPATH in Eclipse

807598Oct 28 2006 — edited Oct 29 2006
I'm trying to learn Java using a book I bought. The book came with some useful classes that are used in many of the examples and part of a package. I modified my CLASSPATH environment variable to include the directory where these classes are located and when I compile from the command prompt, everything works fine. Typically, I include the line:

import package_name.*;

at the top of my Java programs and compile using the following command:

javac program_name.java

I would also like to learn Eclipse as it seems to be a great IDE. However, I can't for the life of me figure out how to make sure that Eclipse finds the correct class libraries or how to update the CLASSPATH variable in Eclipse.

When I try to compile my programs in Eclipse with the same import statement above I consistently get an error that Eclipse cannot resolve the package name.

I would appreciate any help on how to correct this and what steps I need to take to tell Eclipse where to look for packages.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2006
Added on Oct 28 2006
4 comments
964 views