I get the "Process fork failed" error message when I run the ant run command in Ant. Below is the build.xml file.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE project []>
<project name="Learning TestNG" default="usage" basedir=".">
<property environment="env"/>
<property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="G:\Jars_libs"/>
<property name="test.dest" value="${ws.home}/build"/>
<property name="test.src" value="${ws.home}/src"/>
<property name="ng.result" value="G:\Java_Workspace\TestNG_XSLT_reports"/>
<target name="setClassPath" unless="test.classpath">
<path id="classpath_jars">
<fileset dir="${ws.jars}" includes="*.jar"/>
</path>
<pathconvert pathsep=":"
property="test.classpath"
refid="classpath_jars"/>
</target>
<target name="init" depends="setClassPath">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa" />
</tstamp>
<condition property="ANT"
value="${env.ANT_HOME}/bin/ant.bat"
else="${env.ANT_HOME}/bin/ant">
<os family="windows" />
</condition>
<taskdef name="testng" classpath="${test.classpath}"
classname="org.testng.TestNGAntTask" />
</target>
<target name="all">
</target>
<target name="clean">
<delete dir="${test.dest}"/>
</target>
<target name="compile" depends="init, clean" >
<delete includeemptydirs="true" quiet="true">
<fileset dir="${test.dest}" includes="**/*"/>
</delete>
<echo message="making directory..."/>
<mkdir dir="${test.dest}"/>
<echo message="classpath------: ${test.classpath}"/>
<echo message="compiling..."/>
<javac
debug="true"
destdir="${test.dest}"
srcdir="${test.src}"
target="1.8"
classpath="${test.classpath}">
</javac>
</target>
<target name="build" depends="init">
</target>
<target name="run" depends="compile">
<testng classpath="${test.classpath}:${test.dest}" suitename="My Suite">
<xmlfileset dir="${ws.home}" includes="testng.xml"/>
</testng>
</target>
<target name="usage">
<echo>
ant run will execute the test
</echo>
</target>
<path id="test.c">
<fileset dir="${ws.jars}" includes="*.jar"/>
</path>
<target name="makexsltreports">
<mkdir dir="${ws.home}/XSLT_Reports/output"/>
<xslt in="${ng.result}/testng-results.xml" style="src/xslt/testng-results.xsl"
out="${ws.home}/XSLT_Reports/output/index.html" classpathref="test.c" processor="SaxonLiaison">
<param name="testNgXslt.outputDir" expression="${ws.home}/XSLT_Reports/output/"/>
<param name="testNgXslt.showRuntimeTotals" expression="true"/>
</xslt>
</target>
When I run the ant -verbose run command, I get below error. I kindly kindly help me, I googled everything but found nothing. I am very stuck in this and have tried the last 4 days. :(
java.io.IOException: cannot run program "C: \ Program Files \ Java \ jre1.8.0_31 \ bin \ java.exe": create process error = 206, file name or extension is too long.
source
share