Unsupported major.minor version 49.0

Posted on 2006-03-23
Last Modified: 2008-01-09
My System configuration is
-Mac OS X 10.4.5 PowerPC
-JBuilder 2005 Foundation
-J2SE5.0 Release 3

Have a Java based application I developed using JBuilder 2005 with JDK
5.0 and it runs very well through JBuilder.

I am in process of making jar of the same application, After building
the jar, when I try to run it using "java -jar RDH.jar" gives
following exception
Exception in thread "main" java.lang.UnsupportedClassVersionError:
RDHProject/RDH (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
I have reinstalled the J2SE 2.0 but still the problem persists.
Upon some research, I tried to find version of java on my m/c using
"java -version" showed following

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

I suppose the jdk settings are still the older that, and his is why I
am getting problem. I have used functionalty of JDK 1.5 thats why I
have used latest version for compiling my app.

So how to resolve this issue ? I hope many people over this group have
faced similiar kind of problem. Do we need to change the profile
settings in etc ??

Please suggest.

Question by:rohitdivas
    LVL 92

    Accepted Solution

    either use 1.5 to run it
    or compile it wiuth option -target 1.4

    Author Comment

    how to use 1.5 to run it ? Can you write down the whole command ?
    for Mac OS
    LVL 92

    Expert Comment

    you need to know where it is installed
    LVL 12

    Assisted Solution

    >Have a Java based application I developed using JBuilder 2005 with JDK
    >5.0 and it runs very well through JBuilder.
    >I am in process of making jar of the same application, After building
    >the jar, when I try to run it using "java -jar RDH.jar"

    If your JBuilder2005 use a Jdk1.5 to compile, the .class files and the .jar files could be executed only by a Jdk1.5.
    To compile in 1.4 version using jdk1.5 you must specify the -target option.
    If you use JBuilder2005 to compile, you must set the project properties with target option 1.4.
    If you use javac to compile, you must use like following:
    (supposing your jdk1.5 is on /jdk1.5/bin directory)
    /jdk1.5/bin/javac -target 1.4

    See here for detail:

    Hope this could help you.
    Bye, Giant.

    LVL 86

    Assisted Solution

    Open a command prompt and type

    which java

    Choose the version that's 1.5 and use the whole path to run the app

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    This video teaches viewers about errors in exception handling.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now