Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

HELP! - Exception in thread "main" java.lang.UnsupportedClassVersionError

Thread view: 
crab.dae@gmail.com - 22 Jul 2007 23:02 GMT
I'm going through the Tutorial on Sun's site and have installed JDK SE
Update 2.

I 1st uninstalled all JAVA from my PC, then did the install, leaving
all settings with the default value of the installer.

After install, I ran into a problem with using JAVAC to compile
HelloWorldApp from the tutorial.  That was fixed with a change in the
Enviro Variable to ClassPath set to C:\Program Files\Java
\jdk1.6.0_02\bin

Afterwards, I tried to run it from c:java.  From the c:\java
directory, I typed java HelloWorldApp when I get the below error:

==========
C:\JAVA>java helloworldapp
Exception in thread "main" java.lang.UnsupportedClassVersionError:
helloworldapp
(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)
==========

I then tried added C:\Program Files\Java\jdk1.6.0_02 to the PATH
Enviroment Variable and I still get the error.  I'm thinking it might
be a problem with Oracle.  Below is my PATH variable. Should I move C:
\Program Files\Java\jdk1.6.0_02 and/or change it to something else?

C:\Program Files\Oracle\Ora92\bin;
C:\Program Files\Oracle\jre\1.3.1\bin;
C:\Program Files\Oracle\jre\1.1.8\bin;
%SystemRoot%\system32;%SystemRoot%;
%SystemRoot%\System32\Wbem;%SystemRoot%\system32;
%SystemRoot%;%SystemRoot%\System32\Wbem;
C:\Program Files\ATI Technologies\ATI Control Panel;
C:\Program Files\Visual Networks\Dial Analysis\;
C:\Program Files\Microsoft SQL Server\80\Tools\BINN;
C:\Program Files\Common Files\Adaptec Shared\System;
%HummPATH%;C:\sybtools\ASEP;
c:\sqlany50\win32;c:\sybtools\win32;
C:\Program Files\Java\jdk1.6.0_02\

Thanks!!!
Greg R. Broderick - 23 Jul 2007 00:17 GMT
crab.dae@gmail.com wrote in news:1185141746.412847.205850
@n60g2000hse.googlegroups.com:

> I then tried added C:\Program Files\Java\jdk1.6.0_02 to the PATH
> Enviroment Variable and I still get the error.  I'm thinking it might
> be a problem with Oracle.  Below is my PATH variable. Should I move C:
> \Program Files\Java\jdk1.6.0_02 and/or change it to something else?

Yes :-)

I'd recommend removing both of the Oracle JREs from your path, they're the
primary cause of the problem.  Oracle's apps will be able to use the
runtime environment that you've installed as part of the JDK 1.6.  You also
want to change

C:\Program Files\Java\jdk1.6.0_02

to

C:\Program Files\Java\jdk1.6.0_02\bin

Cheers
GRB

Signature

---------------------------------------------------------------------
Greg R. Broderick                  usenet200705@blackholio.dyndns.org

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------

Patricia Shanahan - 23 Jul 2007 00:28 GMT
> crab.dae@gmail.com wrote in news:1185141746.412847.205850
> @n60g2000hse.googlegroups.com:
[quoted text clipped - 16 lines]
>
> C:\Program Files\Java\jdk1.6.0_02\bin

Also, check that you have the right Java version using:

java -version

Patricia
crab.dae@gmail.com - 23 Jul 2007 02:12 GMT
> > crab....@gmail.com wrote in news:1185141746.412847.205850
> > @n60g2000hse.googlegroups.com:
[quoted text clipped - 22 lines]
>
> Patricia

Patricia,

I should have posted that I had already checked the version...  That
was one of the 1st things I did because I knew I had uninstalled all
the JAVA before installing version 1.6.0.  It through me for a loop
because I couldn't figure out why there was a version problem.

Thanks!
crab.dae@gmail.com - 23 Jul 2007 02:11 GMT
On Jul 22, 7:17 pm, "Greg R. Broderick"
<usenet200...@blackholio.dyndns.org> wrote:
> crab....@gmail.com wrote in news:1185141746.412847.205850
> @n60g2000hse.googlegroups.com:
[quoted text clipped - 27 lines]
> Q. What is the most annoying thing on Usenet?
> ---------------------------------------------------------------------

Greg,

Removing the Oracle JRE's allowed it to work perfect.  Thanks!!
bikeriderga@gmail.com - 23 Jul 2007 02:42 GMT
On Jul 22, 6:02 pm, crab....@gmail.com wrote:
> I'm going through the Tutorial on Sun's site and have installed JDK SE
> Update 2.
[quoted text clipped - 6 lines]
> Enviro Variable to ClassPath set to C:\Program Files\Java
> \jdk1.6.0_02\bin

Glad you got it working, but although I know Sun's installers put the
runtime in the Program Files folder, it is always a good idea NOT to
use spaces where java is located.

Also, if you have several Java Versions on your machine (a pain in
Windows because of the registry), creating a batch file to run your
programs will make sure you are using the right version).
Roedy Green - 23 Jul 2007 04:25 GMT
> java.lang.UnsupportedClassVersionError:

see http://mindprod.com/jgloss/helloworld.html
http://mindprod.com/jgloss/runerrormessages.html#UNSUPPORTEDCLASSVERSIONERROR
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.