JDK-4177807 : Bug 4138619 not fixed in 1.2beta4 as claimed
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:class_loading
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-09-30
  • Updated: 1998-10-01
  • Resolved: 1998-10-01
Related Reports
Relates :  
Description

Name: tb29552			Date: 09/30/98


Executable jar files still do not work under Solaris 2.6 with
latest JDK for Solaris.  Reference bug report 4138619.


Java Version:

 > java -version       
 java version "1.2"
 Solaris VM (build 
 Solaris_JDK_1.2_01_dev04_beta4K, native threads, 
 sunwjit)

Test Program:

 > more HelloWorld.java
 public class HelloWorld {
   public static void main(String[] args) {
     System.out.println("Hello World");
   }
 }

Manifest file:

 > more META-INF/MANIFEST.MF
 Manifest-Version: 1.0
 Main-Class: HelloWorld
 Name: HelloWorld.class

Compile:

 > javac HelloWorld.java

Create jar file with manifest:

 > jar cfm HelloWorld META-INF/MANIFEST.MF HelloWorld.class

Give jar file executable permission:

 > chmod +x HelloWorld

Try to execute the jar file:

 > HelloWorld
 HelloWorld: syntax error at line 1: `\2161 264\260\306\321\343\330\340\330\344\330r`\3
 00\266\321\202
 [deleted rest]


Run jar file using -jar option:

 > java -jar HelloWorld
 Hello World


OS Info:
 Hostname: cypher
 Hostid: 809344bc
 Release: 5.6
 Kernel architecture: sun4u
 Application architecture: sparc
 Hardware provider: Sun_Microsystems
 Domain: 
 Kernel version: SunOS 5.6 Generic 105181-06 
   April 1998
(Review ID: 39733)
======================================================================

Comments
EVALUATION You need to install the jexec program in /usr/java/lib. See the evaluation for bug 4138619. The Solaris 2.6 kernel has been updated to recognize the JAR magic number to load jexec with the right arguments. jexec.c: #include <unistd.h> #include <stdlib.h> #include <limits.h> #include <stdio.h> #define JAVA_HOME "/your/jdk1.2beta4/solaris" main(int argc, char *argv[], char *envp[]) { char path[PATH_MAX]; char *s = getenv("JAVA_HOME"); if (s == 0) { s = JAVA_HOME; } if (strlen(s) > PATH_MAX - 11) { fprintf(stderr, "jexec: Path too long"); exit(1); } sprintf(path, "%s/bin/java", s); if (execve(path, argv, envp) == -1) { perror(path); } } ###@###.### 1998-10-01
01-10-1998