stevanity
December 3rd, 2011, 12:50 PM
I installed ubuntu and I didnt notice OpenJDK 6 already installed. Then I installed openjdk 7 via apt-get. and then when I ran javac command I could compile stuff without problems.
But then I ran java command but I get "UnsupportedClassVersionError"...
My Java version:
steve@ubuntu:~$ java -version
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
JAVA_HOME:
$ echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-amd64
But when I do a "whereis java" I get pointed to "/usr/bin/java" which inturn points to "/etc/alternatives/java" which points to "/usr/lib/jvm/java-6-openjdk/jre/bin/java"
I tried setting the CLASSPATH to "/usr/lib/jvm/java-7-openjdk-amd64/lib" then I get the "ClassNotFoundException"
Please help me resolve this. I am also willing to purge all java outta my pc and re installing afresh if nothing works out.
But then I ran java command but I get "UnsupportedClassVersionError"...
My Java version:
steve@ubuntu:~$ java -version
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
JAVA_HOME:
$ echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-amd64
But when I do a "whereis java" I get pointed to "/usr/bin/java" which inturn points to "/etc/alternatives/java" which points to "/usr/lib/jvm/java-6-openjdk/jre/bin/java"
I tried setting the CLASSPATH to "/usr/lib/jvm/java-7-openjdk-amd64/lib" then I get the "ClassNotFoundException"
Please help me resolve this. I am also willing to purge all java outta my pc and re installing afresh if nothing works out.