File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Class Path and Path problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Class Path and Path problem" Watch "Class Path and Path problem" New topic

Class Path and Path problem

vidhya subramaniam

Joined: Apr 11, 2007
Posts: 3
I have set my Class Path and Path as follows

export PATH


. /d01/oracle/devappl/APPSORA.env

I have mentioned the directory where the java is installed in the Path and the rt.jar file in the Class Path but still when I try to run the java command
java test
it gives me an error
Exception in thread main No Class Def Found error. Please help

Srikanth Ramu
Ranch Hand

Joined: Feb 20, 2007
Posts: 76
export PATH is to execute java,javac etc at any location. This more to your OS.

export CLASSPATH is to set your classes and dependent classes in your the classpath for java to load

when you are executing "java test" you need to specify where your test class resides.

for eg:
"export CLASSPATH=/home" assuming the test.class is in /home folder and has no package structure

for more details refer:
subject: Class Path and Path problem
It's not a secret anymore!