Results 1 to 3 of 3
  1. #1
    Moses76 is offline Member
    Join Date
    May 2012
    Rep Power

    Default UnsupportedClassVersionError

    [QUOTE=pbrockway2;90391]The following works for me (hw.jar just prints hello world to the console).

    @echo OFF
    java -jar g:\hw.jar

    I tried this and it gives me this message:-- please please help..

    Exception in thread "main" java.lang.UnsupportedClassVersionError: cmdb/MainForm

    : Unsupported major.minor version 51.0

    at java.lang.ClassLoader.defineClass1(Native Method)

    at java.lang.ClassLoader.defineClassCond(Unknown Source)

    at java.lang.ClassLoader.defineClass(Unknown Source)

    at n Source)

    at Source)

    at$000(Unknown Source)

    at$ Source)

    at Method)

    at Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    Could not find the main class: cmdb.MainForm. Program will exit.

    Press any key to continue . . .
    Thats all it does .

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Double-clicking .jar files?

    You've compiled in Java 1.7 (that's the '51' in the error message), but are trying to run in an earlier version of Java.
    Last edited by Tolls; 05-18-2012 at 04:46 PM. Reason: typo
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: UnsupportedClassVersionError

    Moses76, don't post to old dead threads and don't hijack another poster's thread, especially with an unrelated question. Your problem has nothing at all to do with the question asked and answered in

    Whenever you have a question, start a new thread; they're free.

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 14
    Last Post: 04-18-2011, 11:44 AM
  2. java.lang.UnsupportedClassVersionError
    By gskn4u in forum New To Java
    Replies: 10
    Last Post: 10-03-2009, 05:20 PM
  3. Replies: 2
    Last Post: 12-02-2008, 12:01 PM
  4. java.lang.UnsupportedClassVersionError
    By bbq in forum Advanced Java
    Replies: 1
    Last Post: 07-05-2007, 05:05 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