Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class Path and Path problem

 
vidhya subramaniam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic