atom feed11 messages in org.apache.ant.userRe: Process Fork Failed?
FromSent OnAttachments
Mr james asherJun 16, 2003 1:18 pm 
Antoine Levy-LambertJun 16, 2003 1:38 pm 
Mr james asherJun 16, 2003 1:42 pm 
James AsherJun 17, 2003 1:24 pm 
Antoine Levy-LambertJun 18, 2003 12:30 am 
James AsherJun 18, 2003 1:32 pm 
James BlackJun 18, 2003 1:35 pm 
W. Sean HennessyJun 18, 2003 1:39 pm 
Antoine Levy-LambertJun 18, 2003 2:51 pm 
James AsherJun 19, 2003 1:24 pm 
James AsherJun 23, 2003 2:17 pm 
Subject:Re: Process Fork Failed?
From:Antoine Levy-Lambert (levy@tiscali-dsl.de)
Date:Jun 18, 2003 2:51:00 pm
List:org.apache.ant.user

James,

first of all I am a bit surprised at the directory name /---/ , it is not usual to use the minus sign in paths. The other strange thing is that Java 1.2 comes ahead in your path, but you set JAVA_HOME to java 1.3 Could you make sure that your JAVA_HOME matches with your path, maybe this would help. Typically in your .profile or login script, you should have something like that :

export JAVA_HOME=/---/java-1.3 export PATH=${JAVA_HOME}/bin:${PATH}

this would be the Korn Shell version; if you use C Shell or something else, please adapt.

Your ant -verbose output does not show class not found exceptions, rather it looks like the java executable is not found where ant expects it to be.

You can try to write a small test program and call the org.apache.tools.ant.util.JavaEnvUtils#getJreExecutable function (which is static, so it should be easy), and print the result to System.out Then you can check whether the result of the function makes sense and points to an existing java binary.

Hope this helps.

I looked into the things you suggested, they don't seem to help.

JAVA_HOME is set: JAVA_HOME=/---/java-1.3

the java executeable is located in this directory: /---/java-1.3/jre/bin/

when I run a "java -version" I get this output: java version "1.2.2" Solaris VM (build Solaris_JDK_1.2.2_07a, native threads, sunwjit)

I'm not too familiar with where the main java jar would be ( I'm assuming that's how java is set up, I really don't know for sure ). If that's confusing, then where would I look to find if java.lang.UNIXProcess.forkAndExec actually exists? or org.apache.tools.ant.util.JavaEnvUtils#getJreExecutable for that matter?

I appreciate you taking the time to help me out.

- James

--- Antoine Levy-Lambert <levy@tiscali-dsl.de> wrote:

Hi James,

this bit looks like it is the center of your problem :

java.io.IOException: /---/java-1.3/jre/bin/java: cannot execute at java.lang.UNIXProcess.forkAndExec(Native Method)

Can it be that the environment variable JAVA_HOME is not set on your system ? If it is not set, set it and retry.

Other possibility : can it be that you have a JDK installed somewhere under java-1.3, but you have deleted the JRE bit, or you have the JRE bit but there is not java executable where ant expects it ?

The JRE executable is sought by ant in

org.apache.tools.ant.util.JavaEnvUtils#getJreExecutable

java.io.IOException: /---/java-1.3/jre/bin/java: cannot execute at java.lang.UNIXProcess.forkAndExec(Native Method)

If all of this does not help, tell us which JDK and which operating system are you working under.

Cheers,

Antoine

----- Original Message ----- From: "James Asher" <thej@yahoo.com> To: "Ant Users List" <us@ant.apache.org> Sent: Tuesday, June 17, 2003 10:24 PM Subject: Re: Process Fork Failed?

Any ideas? This is plaguing me.

--- Mr james asher <thej@yahoo.com> wrote:

This is the output I get when I run it in verbose mode:

BUILD FAILED file:/----/WEB-INF/build.xml:212: Process fork failed. at

org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnit

Task.java:682)

at

org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.jav

a:554)

at

org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.jav

a:527)

at org.apache.tools.ant.Task.perform(Task.java:319) at

org.apache.tools.ant.Target.execute(Target.java:309)

at

org.apache.tools.ant.Target.performTasks(Target.java:336)

at

org.apache.tools.ant.Project.executeTarget(Project.java:1306)

at

org.apache.tools.ant.Project.executeTargets(Project.java:1250)

at

org.apache.tools.ant.Main.runBuild(Main.java:610)

at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235) --- Nested Exception --- java.io.IOException: /---/java-1.3/jre/bin/java: cannot execute at java.lang.UNIXProcess.forkAndExec(Native Method) at

java.lang.UNIXProcess.<init>(UNIXProcess.java:54)

at java.lang.Runtime.execInternal(Native Method) at java.lang.Runtime.exec(Runtime.java:551) at java.lang.reflect.Method.invoke(Native Method) at

org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.jav

a:647)

at

org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:417)

at

org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:428)

at

org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnit

Task.java:680)

at

org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.jav

a:554)

at

org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.jav

a:527)

at org.apache.tools.ant.Task.perform(Task.java:319) at

org.apache.tools.ant.Target.execute(Target.java:309)

at

org.apache.tools.ant.Target.performTasks(Target.java:336)

at

org.apache.tools.ant.Project.executeTarget(Project.java:1306)

at

org.apache.tools.ant.Project.executeTargets(Project.java:1250)

at

org.apache.tools.ant.Main.runBuild(Main.java:610)

at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235)

--- Antoine Levy-Lambert <levy@tiscali-dsl.de> wrote:

Can you try to run ant in verbose mode ant -verbose you will get more output, maybe telling you where the problem is Antoine

----- Original Message ----- From: "Mr james asher" <thej@yahoo.com> To: <us@ant.apache.org> Cc: <thej@yahoo.com> Sent: Monday, June 16, 2003 10:18 PM Subject: Process Fork Failed?

I get this message when I run my code as below:

test:

BUILD FAILED -------/build.xml:213: Process fork failed.

the code( line 213 is the <classpath> line ):

<target name="test" depends="test-compile"> <junit printsummary="false"

=== message truncated ===