Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

java.lang.UnsupportedClassVersionError:

csckidJun 18 2008 — edited Jun 18 2008
I have installed oracle10g.......after that java is not running in command prompt but it works in JCreator.... the exception is
Exception in thread "main" java.lang.UnsupportedClassVersionError: myProject (Un
supported major.minor version 50.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Comments

791266
Version 50 means that Java 6 is required. Oracle probably changed your path.

Kaj
807601
I think 50 means version 1.6. What is happening is that your compiler was 1.6 but the JRE you are trying to run it under is older. Perhaps when you installed Oracle it changed your classpath. I seem to remember Oracle f*cks with the CLASSPATH and PATH environment variables which is unforgivable.

Take a look at what JREs you have installed, take a look at your classpath and check this:

$java -version

Edited by: DrLaszloJamf on Jun 18, 2008 10:25 AM
791266
DrLaszloJamf wrote:
I think 50 means version 1.6. What is happening is that your compiler was 1.6 but the JRE you are trying to run it under is older. Perhaps when you installed Oracle it changed your classpath. Take a look at what JREs you have installed, take a look at your classpath and check this:

$java -version
I'm not 100% sure, but I think the path is the problem in this case, and not the classpath.

Kaj
807601
kajbj wrote:
DrLaszloJamf wrote:
I think 50 means version 1.6. What is happening is that your compiler was 1.6 but the JRE you are trying to run it under is older. Perhaps when you installed Oracle it changed your classpath. Take a look at what JREs you have installed, take a look at your classpath and check this:

$java -version
I'm not 100% sure, but I think the path is the problem in this case, and not the classpath.

Kaj
You're right but I went back and edited my post. I think Oracle edits both variables.
csckid
classpath
.;C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip;C:\Program Files\Java\jre1.6.0\bin;C:\Program Files\Java\jdk1.6.0_05\bin;C:\javamail\javamail\mail.jar;C:\javamail\jaf\let see\javax\activation;C:\javamail\javamail\lib

path
E:\oracle\bin;E:\oracle\jre\1.4.2\bin\client;E:\oracle\jre\1.4.2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jre1.6.0\bin;C:\Program Files\Java\jdk1.6.0_05\bin;C:\javamail\javamail\mail.jar;C:\javamail\jaf\activation.jar;C:\Program Files\Common Files\Adobe\AGL


java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

javac -version
javac 1.6.0_05
807601
csckid wrote:
classpath
.;C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip;C:\Program Files\Java\jre1.6.0\bin;C:\Program Files\Java\jdk1.6.0_05\bin;C:\javamail\javamail\mail.jar;C:\javamail\jaf\let see\javax\activation;C:\javamail\javamail\lib

path
E:\oracle\bin;E:\oracle\jre\1.4.2\bin\client;E:\oracle\jre\1.4.2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jre1.6.0\bin;C:\Program Files\Java\jdk1.6.0_05\bin;C:\javamail\javamail\mail.jar;C:\javamail\jaf\activation.jar;C:\Program Files\Common Files\Adobe\AGL


java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

javac -version
javac 1.6.0_05
That's what I meant. javac calls the version 1.6 compiler but java calls the 1.4 JRE.

Solution: I'm not one for going in and mucking with the PATH variable again. You write the absolute path instead of just writing "java"; if that gets tedious you can write a little batch file, or use ant, or use an IDE (ducks).
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 16 2008
Added on Jun 18 2008
6 comments
177 views