Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6707036

VM launcher should better describe supported classfile versions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • hotspot
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      This error message occurs when a JVM attempts to run bytecode compiled by a new version of Java. It should say that. In addition, either the "major.minor" version should be included by 'java -version', or don't include it in the error message.

      JUSTIFICATION :
      There is no easy way to correlate a major.minor version to a Java VM version. The existing error message is unnecessarily confusing, and generates lots of Google searches, or worse: casual users will just abandon the attempt to run the app, and probably leave with a sour taste in their mouth regarding Java in general.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would like to see a more informative, useful message like:

      "This Java program appears to be compiled by a version of Java newer than what this version (JVM 1.x) can support. Please upgrade your Java version, or recompile with -target 1.x."
      ACTUAL -


      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)


      ---------- BEGIN SOURCE ----------
      Compile any application with a new JDK, then run with an older JRE.
      ---------- END SOURCE ----------

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: