The Artima Developer Community
Sponsored Link

Java Answers Forum
Unsupported major.minor version 49.0

12 replies on 1 page. Most recent reply: May 14, 2009 8:25 AM by lei wang

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 12 replies on 1 page
chaitanya

Posts: 1
Nickname: gvs
Registered: May, 2005

Unsupported major.minor version 49.0 Posted: May 6, 2005 1:59 AM
Reply to this message Reply
Advertisement
Hi,

I am getting this error when I am trying to run a program to connect to a database...

earlier I was getting "suitable driver not found"..

now I am getting this error... "Unsupported major.minor version 49.0"

if there is a problem with the compiled version of the class and the JVM on my machine... can anybody help me out by telling which version of the JVM should I download... and also from where..
as I just downloaded the JRE from Sun website... JRE 1.4 ( I suppose )...

It would be great if anyone can help me out with this...
thanx in advance...
GVS


Lynn Hollerman

Posts: 67
Nickname: gmholler
Registered: Mar, 2002

Re: Unsupported major.minor version 49.0 Posted: May 6, 2005 1:26 PM
Reply to this message Reply
I think a major.minor version of "49.0" indicates JDK 1.5 (I know 1.4 was 48.0.) As of right now, you're only asking for problems if you go with 1.5 - it's still "too new" for lots of applications. Go back to the Sun site and be sure you get JDK 1.4 - I was just there the other day, and it's still available for download.

Lynn.

Robin Clark

Posts: 2
Nickname: rpc48gx
Registered: Jan, 2006

Re: Unsupported major.minor version 49.0 Posted: Jan 29, 2006 12:09 PM
Reply to this message Reply
This is unusual for SUN. I used to look up to them, but then in 1988 microsoft were the ANSI C standard I looked up to...

Robin Clark

Posts: 2
Nickname: rpc48gx
Registered: Jan, 2006

Re: Unsupported major.minor version 49.0 Posted: Jan 29, 2006 1:07 PM
Reply to this message Reply
Try this for when they do have their act together.

de_generic_java.sh

------------------------------------------------



#
#
# Find all java files and comment out all text between < and >
#
# i.e. de generisise it.
#

ll=`ls -l *.java | awk '{print $8}'`
echo $ll

for l in $ll
do
cp $l $l.java_1.5
cat $l | sed 's/Vector\(<[ a-zA-Z0-9]*>\)/Vector \/\* \1 \*\/ /g' > $l.java_1.3
mv $l.java_1.3 $l
done







-----------------------------------------------------

Surekha Prakash

Posts: 1
Nickname: surkhi
Registered: Jun, 2006

Re: Unsupported major.minor version 49.0 Posted: Jun 7, 2006 4:25 AM
Reply to this message Reply
Hi All,

Similar error while I was executing a small JMF program.
I installed JMF and JDK1.4.2_02, also JDK1.5.0_05.
I am able to compile through JCreato Pro, but not able to execute. Someone please help !!!

C:\>appletviewer JMFAudioLoop.java
java.lang.UnsupportedClassVersionError: JMFAudioLoop (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:157)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:561)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:617)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:546)
at sun.applet.AppletPanel.run(AppletPanel.java:298)
at java.lang.Thread.run(Thread.java:534)

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Unsupported major.minor version 49.0 Posted: Jun 7, 2006 5:41 AM
Reply to this message Reply
1. Compile your code, you will get JMFAudioLoop.class
2. If you want to call a Java Prorgam you need to specify the complete Path + ClassName (no extension)
Call:
c:\MyFirstProgram\>appletviewer JMFAudioLoop

You really should take a look at the Java Language specification, also learn how to use java.exe, javac.exe and appletviewer.exe

I never used appletviewer, maybe you have to type "-cp . ", too.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Unsupported major.minor version 49.0 Posted: Jun 7, 2006 6:39 AM
Reply to this message Reply
This general issue is not specific 1.5 and it's not a classloader issue.

The class was compiled with a verison of the JDK that is incompatible JRE you are attempting to use at runtime. I believe you are trying to load a 1.5 class in a 1.4 JRE.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Unsupported major.minor version 49.0 Posted: Jun 7, 2006 7:25 AM
Reply to this message Reply
Sorry, my fault. Thought that appletviewerw needs similary conditions as java.exe.

Balamurugan R

Posts: 1
Nickname: balar
Registered: Dec, 2006

Re: Unsupported major.minor version 49.0 Posted: Nov 30, 2006 11:41 PM
Reply to this message Reply
It is because of the JVM version. You might have compiled and build the class files using JVM 5.0 and run it using JVM 1.4
So change the JVM path to 1.4 before compiling it and run. It will work. I got such a problem and changed the eclipse build version to 1.4 and the problem got solved...

Doug Gunnoe

Posts: 22
Nickname: dgun
Registered: May, 2007

Re: Unsupported major.minor version 49.0 Posted: May 12, 2007 3:06 AM
Reply to this message Reply
I know this thread is old, but in case someone finds it like I did...

Previously with 1.4 if I wanted to compile for another version I just used the -target "version" switch and it worked. Like "javac -target 1.1 stuff.java". But that does not work for 1.5.

I had to do this "javac -source 1.4 -target 1.4 stuff.java"

Hope that helps.

Rama Krishna Anumola

Posts: 1
Nickname: rkanumola
Registered: Jul, 2007

Re: Unsupported major.minor version 49.0 Posted: Jul 30, 2007 11:21 PM
Reply to this message Reply
Hi,

this is Rama Krishna, i to got the same problem, while execute a java file in the eclipse, if u r using eclipse, this may help you, for this we need check Window>Preference>Java>Compiler. here we are having the check box mentioning the JDK compliance, there we need to place the jre of the version which we are placed in the InstalledJREs....

Anallely Olivares

Posts: 1
Nickname: aolivares
Registered: Jan, 2008

Re: Unsupported major.minor version 49.0 Posted: Jan 22, 2008 1:56 PM
Reply to this message Reply
I had this error 3 hours ago, and the solution was really silly in my case.

In the run file forgot erase the commentary #JAVA_HOME
.....
#JAVA_HOME=/usr/local/java
JAVA="${JAVA_HOME}/bin/java"
JAVA_O PTS= ...
CLASSPATH=...
.....
.....
# Arranca la aplicacion.
${JAVA} ${JAVA_OPTS} -cp ${CLASSPATH} mx.example.aolivares.Main

Well, I suppose this dont explain nothing, but remember check your code before desesperate.

lei wang

Posts: 1
Nickname: lei2009
Registered: May, 2009

Re: Unsupported major.minor version 49.0 Posted: May 14, 2009 8:25 AM
Reply to this message Reply
I used your code and it worked on compiling the java codes on jdk 1.5. I have been seaching this online for a while, and your code is the only that works in a easiest way.
Thank you very much!

Flat View: This topic has 12 replies on 1 page
Topic: Java Virtual Machine Launcher Previous Topic   Next Topic Topic: Constructor, setters and getters

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use