PDA

View Full Version : [ubuntu] What is wrong with Java Environment Path?



esya
May 27th, 2010, 01:14 PM
I set up java-6-sun-1.6.20 by using Synaptic Package Manager and I updated PATH variable and added JAVA_HOME by chancing /etc/environment file.

My environment file:


#begin
JAVA_HOME = /usr/lib/jvm/java-6-sun-1.6.0.20/
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun-1.6.0.20/bin/"
#end
When I wrote echo $JAVA_HOME I got one empty line.

And I tried java. I got error.


~$ java
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
I did not understand what is wrong. What can I do to fix the problem?

dino99
May 27th, 2010, 03:32 PM
is java_home created ? why have you change the path ?

esya
May 27th, 2010, 04:21 PM
I tired
~$ echo $JAVA_HOME in the terminal and I cannot see any result.
I think Java_home is not created.


I chanced path because I searched the error of Java command which is:


~$ java
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
in the web and they were saying that add your Java path to the path environment and add Java_Home to the etc/environment file. So I added Java path to the end of my path variable and I add Java_Home variable to the beginning of the environment file.