Results 1 to 1 of 1

Thread: NetBeans Unsupported major/minor version

  1. #1
    Join Date
    Jan 2010
    Ubuntu 10.04 Lucid Lynx

    NetBeans Unsupported major/minor version

    Hey everyone,

    I ran into some issues while trying to compile a really straightforward Java program.

            JFrame frame = new JFrame("a frame");
            frame.add(new JButton("a button"));
    When I compile it, and run it in Netbeans, it works just perfectly, and shows the JFrame and JButton.

    When I try to open the .jar it produces (either by right-clicking and selecting "open with openjdk 6 runtime" or "openjdk 7 runtime", or by using the "java -jar" command) it fails.

    output of java -jar <filename>
    Exception in thread "main" java.lang.UnsupportedClassVersionError: javaapplication1/JavaApplication1 : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass( :634)
    at .java:277)
    at$000(URLClassLoader. java:73)
    at$ 212)
    at Method)
    at ava:205)
    at java.lang.ClassLoader.loadClass( 21)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche
    at java.lang.ClassLoader.loadClass( 66)
    Could not find the main class: javaapplication1.JavaApplication1. Program will exit.

    the output of javac -version:
    javac 1.6.0_24

    the output of java -version:
    java version "1.6.0_24"
    OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
    OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

    Can anyone help me out?

    Thanks in advance.
    Last edited by JakeFrederix; June 10th, 2012 at 02:45 AM. Reason: added actual error output

Tags for this Thread


Posting Permissions

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