aspose file tools*
The moose likes JDBC and the fly likes Java.lang.UnsupportedClassVersionError: test (Unsupported major.minor version 50.0) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Java.lang.UnsupportedClassVersionError: test (Unsupported major.minor version 50.0)" Watch "Java.lang.UnsupportedClassVersionError: test (Unsupported major.minor version 50.0)" New topic
Author

Java.lang.UnsupportedClassVersionError: test (Unsupported major.minor version 50.0)

shiva valanukonda
Greenhorn

Joined: Sep 27, 2010
Posts: 25

Hi ,

I have changed my PC recently. so i have installed all the softwares mentioned below.

Java 1.6
Tomcat 6

After that i installed Oracle 10g.

I have set the class path properly like the below.
PATH : C:\Program Files\Java\jdk1.6.0\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;.
CLASS PATH : C:\Program Files\Java\jre1.6.0\lib\rt.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib;C:\oracle\product\10.1.0\Db_1\jdbc\lib\classes12.jar;E:\hibernateJAR\antlr-2.7.6.jar;E:\hibernateJAR\asm.jar;E:\hibernateJAR\cglib-2.1.3.jar;E:\hibernateJAR\commons-collections-2.1.1.jar;E:\hibernateJAR\commons-logging-1.0.4.jar;E:\hibernateJAR\dom4j-1.6.1.jar;E:\hibernateJAR\hibernate3.jar;E:\hibernateJAR\jta.jar;E:\hibernateJAR\log4j-1.2.11.jar;.;


I am getting the below error when i run my test program:

C:\Documents and Settings\shiva\Desktop>java test
Exception in thread "main" java.lang.UnsupportedClassVersionError: test (Unsupported 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)

And my system pointing to Java 1.4 version when i run the java -version on command prompt

C:\Documents and Settings\shiva\Desktop>java -version
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)


Please help me ..

Thanks



William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

It looks like your 1.6 Java is not getting picked up.

I would find out exactly where it's picking up java.exe from.

Your PATH example is very short, I would expect to see c:\windows etc.. in there.
I'll bet if you show and follow the Windows path you'll find the old 1.4 executable.

WP
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

To explain the error message to you, version 50 refers to java 6. Your machine is expecting class version 48 i.e java 1.4.

Anrd
"One of the best things you could do is to simplify a larger application into a smaller one by reducing its process and complexity - Fowler"
shiva valanukonda
Greenhorn

Joined: Sep 27, 2010
Posts: 25

Hi William P O'Sullivan,

Could you please let me know what exactly you are referring in PATH.
Some thing like c:\windows etc.. you are expecting ?
what is the default one for Win XP SP3.

Thanks for the reply...


And one more issue is , when i was trying to open Eclipse Version: Indigo Service Release 2, i have got one error saying Java run time error.
I have uninstalled the Oracle 10g now. I started eclipse it is working fine.

So, there might be problem with Oracle ..
Could you please suggest which version of Oracle will be best one.
Wei Dai
Ranch Hand

Joined: Jun 22, 2005
Posts: 86
>Java.lang.UnsupportedClassVersionError: test (Unsupported major.minor version 50.0)
>I have set the class path properly like the below.
PATH : C:\Program Files\Java\jdk1.6.0\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;.
CLASS PATH : C:\Program Files\Java\jre1.6.0\lib\rt
>And my system pointing to Java 1.4 version when i run the java -version on command prompt
Your setting command should be wrong. If you use set in command console, you will find path point to java 1.4
You can try
SET PATH=C:\Program Files\Java\jdk1.6.0\bin;%PATH%
SET CLASSESPATH=C:\Program Files\Java\jre1.6.0\lib\rt;%CLASSESPATH%

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java.lang.UnsupportedClassVersionError: test (Unsupported major.minor version 50.0)
 
Similar Threads
Error in run a java program in another director
Java -Version Problem
UnsupportedClassVersionError
UnsupportedClassVersionError (unsupported major.minor version 50.0)
Runtine Exception UnsupportedClassVersionError