Reputation: 1277
I want to upgrade my jdk on a centos server, after some simple searches i found some solutions.
from this link you can see that the instructions are simple: jdk 7 installation guide for centos
-install your jdk from rpm package or from source
-do some alternatives
-check the practical version (java -version)
and i go easy with the first two steps but in check version step i get this error:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
i have also checked alternatives --config java
and simbolic links.
i have also tried which
command to find out what java is actually running and this was the link directoins.
/usr/bin/java -> /etc/alternatives/java -> /usr/java/jdk-1.8.0_40/bin/java
the weird point is when i run /usr/bin/java -version
it is OK and it returns the version but when i run java
without any prefix i got that error.
so what is the problem?
Upvotes: 1
Views: 855
Reputation: 725
you may need to setup CLASSPATH variable so that jvm could load needed libraries.
see this post https://docs.oracle.com/javase/tutorial/essential/environment/paths.html
Upvotes: 1