my dog learned polymorphism*
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
Author

Class Path and Path problem

vidhya subramaniam
Greenhorn

Joined: Apr 11, 2007
Posts: 3
I have set my Class Path and Path as follows
PATH=$PATH:$HOME/bin:/d02/interface/ap/payment:/d02/interface/ap/payment/saxon.exe:/d01/oracle/devcomn/util/java/1.4/j2sdk1.4.2_04/bin:.:/d01/oracle/devcomn/util/java/1.4/j2sdk1.4.2_04/jre/lib:/d02/interface/ap/payment/saxon

export PATH

CLASSPATH=:/d02/interface/ap/payment/saxon.exe:/d01/oracle/devcomn/util/java/1.4/j2sdk1.4.2_04/bin:.:/d01/oracle/devcomn/util/java/1.4/j2sdk1.4.2_04/jre/lib/rt.jar:/d02/interface/ap/payment/saxon/saxon.jar

export CLASSPATH
unset USERNAME
. /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

Thanks
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:

http://faq.javaranch.com/view?HowToSetTheClasspath
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class Path and Path problem