-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b01
-
generic, x86
-
generic, windows_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2211805 | 7u2 | Kumar Srinivasan | P3 | Closed | Fixed | b02 |
If you create a jar file WITHOUT a “Main-Class” manifest field, and you try to run it by java –jar xxx.jar using Java 7 b147, you get this:
Exception in thread "main" java.lang.NullPointerException
at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:399)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463)
However if you do the same thing in Java 6, you get this:
Failed to load Main-Class manifest attribute from
stringbenchmarkmissingmainclass.jar
Exception in thread "main" java.lang.NullPointerException
at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:399)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463)
However if you do the same thing in Java 6, you get this:
Failed to load Main-Class manifest attribute from
stringbenchmarkmissingmainclass.jar
- backported by
-
JDK-2211805 (launcher) java -jar throws NPE if JAR file does not contain Main-Class attribute
-
- Closed
-
- duplicates
-
JDK-7068742 NullPointerException in sun.launcher.LauncherHelper.getMainClassFromJar
-
- Closed
-
- relates to
-
JDK-7141141 Add 3 new test scenarios for testing Main-Class attribute in jar manifest file
-
- Closed
-