Solved

setting up classpath

Posted on 2002-05-07
1
169 Views
Last Modified: 2013-11-23
Hi,

I have set my classpath to :

/opt/SUNWips/lib/com/ediet

but everytime i try to compile a java file which resides in /opt/SUNWips/lib, it says the files i'm trying to import which resides in /opt/SUNWips/lib/com/ediet
is not found.

After i jar all the files in the com directory and its subdirectories and set the classpath as :

/opt/SUNWips/lib/com/ediet/ediet.jar

it works! I would like to know is it possible to achieve the above..without having to do the jar file step?

Pls advise. Thanks.

0
Comment
Question by:osiruz
1 Comment
 

Accepted Solution

by:
mickoo earned 50 total points
ID: 6993683
That maybe because your Classes are in  the package
/opt/SUNWips/lib/com/ediet

and you have set the classpath to the directory ediet.
Try setting the classpath to the parent directory of opt.
ie: the directory that contains your opt directory.

The runtime for a class named com.org.Test expects to find it in a directory structure
com/org/Test.class
So your classpath should point to where your directory structure starts.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HashMap Vs TreeMap 12 55
Java and GPO 11 68
sites similar to codingbat to improve coding hanson skills 3 40
use lov values 2 24
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now