jdk1.6: Runtime.exec fails always
Huang wen hui
hwh at gddsn.org.cn
Tue Aug 14 16:48:32 PDT 2007
Ronald Klop wrote:
> When I run this programm, I always get exitCode == 255.
> $ java -version
> java version "1.6.0_01-p1"
> Java(TM) SE Runtime Environment (build
> 1.6.0_01-p1-root_12_aug_2007_22_50-b00)
> Java HotSpot(TM) Client VM (build
> 1.6.0_01-p1-root_12_aug_2007_22_50-b00, mixed mode)
> $ uname -a
> FreeBSD ronald.office.base.nl 6.2-STABLE FreeBSD 6.2-STABLE #74: Sat
> Jul 14 13:11:40 CEST 2007
> root at ronald.office.base.nl:/usr/obj/usr/src/sys/RONALD i386
>
> I found it with other code, but this is my small testcase to reproduce
> it.
>
> Can people reproduce this?
>
> Ronald.
>
>
>
> import java.io.IOException;
>
> final class ExecTest {
>
> public static void main(String[] args) throws IOException,
> InterruptedException {
> Runtime rt = Runtime.getRuntime();
> Process p = rt.exec("/bin/ls");
> int exitCode = p.waitFor();
> System.out.println("ExitCode: " + exitCode);
> }
>
> }
>
me too,
%/usr/local/jdk1.6.0/bin/java -version
java version "1.6.0_01-p1"
Java(TM) SE Runtime Environment (build
1.6.0_01-p1-hwh_11_aug_2007_08_30-b00)
Java HotSpot(TM) 64-Bit Server VM (build
1.6.0_01-p1-hwh_11_aug_2007_08_30-b00, mixed mode)
%uname -a
FreeBSD hwh.gddsn.org.cn 7.0-CURRENT FreeBSD 7.0-CURRENT #33: Wed Aug 8
07:31:15 CST 2007 hwh at hwh.gddsn.org.cn:/usr/obj/usr/src/sys/IBM01 amd64
More information about the freebsd-java
mailing list