-
Bug
-
Resolution: Fixed
-
P2
-
1.3.1_01
-
ladybird
-
x86
-
linux
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2037653 | 1.4.0 | David Wallman | P2 | Closed | Fixed | beta |
Name: egR10015 Date: 10/13/2000
The script .java_wrapper from linux jdk1.2.x and jdk1.3.x uses external commands
basename, uname, dirname without absolute pathnames.
So wrapper wrongly assumes that certain pathes to these commands are already set
in user environment but actually this is not right.
Another issue is that tests cannot be run under Tonga harness on Linux platform without
setting these additional pathes in user environment.
Example consists of the two following programs.
Here is the main program:
------------------------------- test.java --------------------------------------
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class test {
public static void main(String args[]) {
String[] env = { "PATH=" };
String s;
try {
Process proc = Runtime.getRuntime().exec(System.getProperty("java.home") +
"/bin/java test1", env);
BufferedReader pout = new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader perr = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
while ((s=pout.readLine())!=null)
System.out.println(s);
while ((s=perr.readLine())!=null)
System.err.println(s);
} catch (IOException e) {
System.err.println("EXEC ERROR : "+e.getMessage());
}
}
}
--------------------------------------------------------------------------------
Here is the invoked program:
----------------------------- test1.java ---------------------------------------
public class test1 {
public static void main(String args[]) {
System.out.println("test1: OK!");
}
}
--------------------------------------------------------------------------------
To reproduce the bug compile test.java and test1.java and run test class as follows:
java test
Note that on all platforms except Linux this test works fine.
--------------------------- output from Solaris --------------------------------
$ /export/ld25/java/dest/jdk1.3/solaris/bin/java test
test1: OK!
--------------------------------------------------------------------------------
---------------------------- output from win32 ---------------------------------
$ h:/hotspot/jdk1.3.0/win32/bin/java test
test1: OK!
--------------------------------------------------------------------------------
---------------------------- output from Linux ---------------------------------
$ /net/linux-15/export/home/jdk1.3.0/linux/bin/java test
Error: can't find libjava.so.
/.automount/linux-15/root/export/home/jdk1.3.0/linux/jre/bin/java: basename: No such file or directory
/.automount/linux-15/root/export/home/jdk1.3.0/linux/jre/bin/java: uname: No such file or directory
/.automount/linux-15/root/export/home/jdk1.3.0/linux/jre/bin/java: uname: No such file or directory
/.automount/linux-15/root/export/home/jdk1.3.0/linux/jre/bin/java: dirname: No such file or directory
--------------------------------------------------------------------------------
======================================================================
- backported by
-
JDK-2037653 Linux: java wrapper does not work without setting certain pathes
- Closed
- relates to
-
JDK-4409527 Solaris: java wrapper uses external command "cut" without absolute pathname
- Closed
-
JDK-4339484 Linux: java wrapper assumes that "grep" location always is "/bin/grep"
- Closed