• Post Reply Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError : /usr/java/jdk1/3/1/lib in Linux  RSS feed

 
mohamed zafer
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello There,
I am using redHat Linux6.2. I have set the classpath in .bashrc
When I run a file withthe following option
java -cp $CLASSPATH file
it gives the following error
NoClassDefFoundError : /usr/java/jdk1/3/1/lib
Why are the "." taken as "/". I have not encountered this problem earlier, recently after reinstalling the same version of Linux I am facing this error
Thanks in advance.
Mohamed Zafer
 
Vikas Sharma
Greenhorn
Posts: 6
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
if u've defined classpath properly in ur .bashrc than u should simply use
java file
it will search for the class where the classpath is set, so be sure u ve included current directory in ur path.
 
mohamed zafer
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vikas,

I have given the class path in bashrc ,also specified the current directory. The entry in .bashrc is

export CLASSPATH=.:/usr/java/jdk1.3.1/lib:/usr/java/classes111.zip

Now when i run the file with the following option it gives the following error.

java -cp $CLASSPATH file

java.lang.NoClassDefFoundError: /:/usr/java/jdk1/3/1/lib:usr/java/classes111/zip
If u could see the "." in the folder name jdk1.3.1 and file classes111.zip is also taken as package delimiters and replaced by "/". Any idea what could be the reason.

Regards
Mohamed zafer
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!