ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregory A. Payne" <kgpa...@earthlink.net>
Subject Java task on Linux
Date Mon, 05 Feb 2001 23:43:15 GMT
Hello,

Trying to use Ant 1.2 with JUnit 3.5 on Linux using the java task.  I
haevn't tried using the junit task because the documentation says this
won't work with JUnit 3.5.  I am trying to get the examples from the
following article to work:

    http://www-106.ibm.com/developerworks/library/j-ant/?dwzone=java

With the sample code for the article at:

    ftp://www6.software.ibm.com/software/developer/library/antsample.zip

The problem seems to be with the "fork" property in the runtests target:

    <target name="runtests" depends="compiletests" if="junit.present">
        <java fork="yes" classname="junit.textui.TestRunner"
            taskname="junit" failonerror="true">
            <arg value="test.com.company.AllJUnitTests"/>
            <classpath>
                <pathelement location="build/lib/${app.name}.jar" />
                <pathelement location="build/testcases" />
                <pathelement path="" />
                <pathelement path="${java.class.path}" />
            </classpath>
        </java>
    </target>

I have tested this with JDK 1.2.2 and JDK 1.3 and it works fine with
fork="no".  When set to fork="yes" (which the sample code uses), I get:

Searching for build.xml ...
Buildfile: /home/greg/antjunit/sample/build.xml

JUNIT:

compile:

jar:

compiletests:

runtests:

BUILD FAILED

/home/greg/antjunit/sample/build.xml:41: java.io.IOException: java:
cannot execute
java.io.IOException: java: cannot execute
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:137)
        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.java)

        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java)
        at org.apache.tools.ant.taskdefs.Java.run(Java.java)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java)
        at org.apache.tools.ant.Target.execute(Target.java)
        at org.apache.tools.ant.Project.runTarget(Project.java)
        at org.apache.tools.ant.Project.executeTarget(Project.java)
        at org.apache.tools.ant.Project.executeTargets(Project.java)
        at org.apache.tools.ant.Main.runBuild(Main.java)
        at org.apache.tools.ant.Main.main(Main.java)

Any help is appreciated.

Thanks,

Greg


Mime
View raw message