Results 1 to 15 of 15
  1. #1
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default Exception in thread "main" java.lang.UnsupportedClassVersionError: hi (Unsupport ed m

    THE ERROR MSG:

    E:\>javac hi.java

    E:\>java hi
    Exception in thread "main" java.lang.UnsupportedClassVersionError: hi (Unsupport
    ed major.minor version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n 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 am using orcle 10g in my system,
    is there any necessity to set classpath for orcle to get normal j2se prgm result.


    iam using jdk 1.5
    plz give me info about error

  2. #2
    JavaHater is offline Senior Member
    Join Date
    Dec 2010
    Posts
    165
    Rep Power
    4

    Default

    the error can happen when you compile the class file with a higher version compiler and then runs it using a lower version. make sure you check your java version.

  3. #3
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default thanku sir

    iam also try to solve using jdk 1.6 vesion ,
    but same thread came

  4. #4
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default regarding java prbl

    iam using WINDOWS SP-3 ,

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,237
    Rep Power
    19

    Default

    What do the following print to the console?
    Java Code:
    javac -version
    java -version
    Make sure you copy the console output here -- don't paraphrase.

    db

  6. #6
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default java & javac versions

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\room>javac -version
    javac 1.5.0
    javac: no source files
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are u
    sed
    -classpath <path> Specify where to find user class files
    -cp <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release

    -target <release> Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system


    C:\Documents and Settings\room>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)

    C:\Documents and Settings\room>

  7. #7
    JavaHater is offline Senior Member
    Join Date
    Dec 2010
    Posts
    165
    Rep Power
    4

    Default

    you have a 1.5 version compiler, but your java version is 1.4.2. try using the same version, either by reinstalling , changing your execution path, or specifying the full path of where your java.exe is installed when you run the class.

  8. #8
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,525
    Blog Entries
    7
    Rep Power
    20

    Default

    That's the answer: the versions of your JDK (javac.exe etc.) and your JRE (java.exe etc.) don't match. Install matching versions; the latest version of both is version 1.6. Note: if you install a JDK the JRE comes with it.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default thanku

    i also trying with jdk1.6,
    but the same error msg came

  10. #10
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default the console error msg from promt

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\room>javac -version
    javac 1.6.0_14

    C:\Documents and Settings\room>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)

    C:\Documents and Settings\room>e:

    E:\>javac hi.java

    E:\>java hi
    Exception in thread "main" java.lang.UnsupportedClassVersionError: hi (Unsupport
    ed major.minor version 50.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n 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)

  11. #11
    JavaHater is offline Senior Member
    Join Date
    Dec 2010
    Posts
    165
    Rep Power
    4

    Default

    which part of our explanation do you not understand? you have javac version 1.6, but you are running your program using java version 1.4.2. if possible, uninstall your 1.4.2 . Or, check where you install your 1.6 and then update your PATH environment variable to point to 1.6

  12. #12
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default thanku

    iam newly downloaded ====jdk-6u23-windows-i586,


    after instalation I set AS
    classpath:C:\Program Files\Java\jdk1.6.0_23\lib;.;
    JAVA_HOME:C:\Program Files\Java\jdk1.6.0_23
    path:C:\Program Files\Java\jdk1.6.0_23\bin

    BUT THE RESULT IS

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\room>javac -version
    javac 1.6.0_23

    C:\Documents and Settings\room>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)



    my confusion is that
    what should i do for getting both versions are same.
    priv i downloaded jdk-6u23-windows-i586 from sun microsystems,inc.

    it also shows above i given commend promt console pested.

    show me how can i run java prog ,
    i am using oracle 10g
    from 10g can i set path is need for getting java SE output?????????

  13. #13
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default thanku

    thanku for your support

    After installing jdk1.4.2_03, my java prog are run properly.
    I tryied somany times with jdk 1.5,1.6 and also jre6 but my system shows java -version as 1.4.2_03, thats way i compermised and i get 1.4.2_03 and now i am working with java prog's
    Thanku for your valuble guidlince
    once again

  14. #14
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,525
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by bsubbaiah85@gmail.com View Post
    thanku for your support

    After installing jdk1.4.2_03, my java prog are run properly.
    I tryied somany times with jdk 1.5,1.6 and also jre6 but my system shows java -version as 1.4.2_03, thats way i compermised and i get 1.4.2_03 and now i am working with java prog's
    Thanku for your valuble guidlince
    once again
    I don't consider this 'solving' your problem; now you are stuck with quite an old Java version. Why didn't you uninstall all the old stuff and install the latest version of Java (1.6).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  15. #15
    javabooster is offline Member
    Join Date
    Apr 2011
    Posts
    1
    Rep Power
    0

    Default

    remove the jre path in oracle 10g.. your 10g version is running on jre1.4.. thats y it is showing uncompatible version..

Similar Threads

  1. Replies: 5
    Last Post: 06-22-2010, 03:51 PM
  2. Replies: 5
    Last Post: 06-02-2010, 01:05 PM
  3. Replies: 1
    Last Post: 11-20-2009, 07:58 PM
  4. Replies: 6
    Last Post: 07-16-2009, 03:30 PM
  5. Replies: 1
    Last Post: 07-16-2009, 10:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •