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

NullPointerException in sun.launcher.LauncherHelper.getMainClassFromJar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • tools
    • jar
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.7.0"
      Java(TM) SE Runtime Environment (build 1.7.0-b147)
      Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      java -jar JarWithNoMainClass.jar

      results in:

      Exception in thread "main" java.lang.NullPointerException
              at sun.launcher.LauncherHelper.getMainClassFromJar(Unknown Source)
              at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      User-friendly error message that explains that the JAR does not specify the class to be executed.

      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: