Details
-
Bug
-
Resolution: Fixed
-
P2
-
1.2.0
-
None
-
1.2beta4
-
generic
-
solaris_2.6
-
Verified
Description
Following PSARC/1997/123, the solaris exec() mechanism was updated to provide
for executing jar executables.
The 1.2 documentation at:
http://java.sun.com/products/jdk/1.2/docs/guide/extensions/spec.html#javacmd
indicates that a Manifest entry of Main-Class will create an executable jar
file and:
The Solaris 2.6 kernel has already been extended to recognize the special
"magic" number that identifies a JAR file, and to invoke java -jar on such
a JAR file as if it were a native Solaris executable. A Java application
packaged in a JAR file can thus be executed directly from the command line
or by clicking an icon on the CDE desktop.
Although the Main-Class entry creates a jar executable suitable for use with
java -jar:
% javac HelloWorld.java
% cat META-INF/MANIFEST.MF
Manifest-version: 1.0
Main-Class: HelloWorld
Name: HelloWorld.class
% jar -native -cvmf META-INF/MANIFEST.MF HelloWorld HelloWorld.class
adding: HelloWorld.class (in=472) (out=316) (deflated 33%)
% java -native -new -jar HelloWorld
Hello world!
This file can not be executed directly:
% chmod +x HelloWorld
% HelloWorld
./HelloWorld: syntax error at line 1: `)' unexpected
truss(1) reveals:
609: execve("./HelloWorld", 0x00052948, 0x00052950) Err#8 ENOEXEC
Attachments
Issue Links
- relates to
-
JDK-6808540 [SC] Is the Extra field code " FE CA 00 00" being used in jar file a "MUST" thing?
- Closed
-
JDK-6480504 java.util.jar.JarOutputStream incorrectly sets 'extra' field
- Closed
-
JDK-4177807 Bug 4138619 not fixed in 1.2beta4 as claimed
- Closed