While executing command, ant compile
It gives Build Error. (See Screenshot as attachment)
'build.xml' content copy pasted below :
<project name="Junit Project" default="usage" basedir=".">
<!-- ========== Initialize Properties =================================== -->
<property environment="env"/>
<property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="C:\QTPSelenium\jar files"/>
<property name="test.dest" value="${ws.home}/build"/>
<property name="test.src" value="${ws.home}/src"/>
<property name="test.reportsDir" value="C:\QTPSelenium\Junit ANT Reports"/>
<path id="testcase.path">
<pathelement location="${test.dest}"/>
<fileset dir="${ws.jars}">
<include name="*.jar"/>
</fileset>
</target>
<!-- all -->
<target name="all">
</target>
<!-- clean -->
<target name="clean">
<delete dir="${test.dest}"/>
</target>
<!-- compile -->
<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.5"
classpath="${test.classpath}"
>
</javac>
</target>
<!-- build -->
<target name="build" depends="init">
</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="run" >
<delete includeemptydirs="true" quiet="true">
<fileset dir="${test.reportsDir}" includes="**/*"/>
</delete>
<java jar="${ws.jars}" fork="true" spawn="true" />
<junit fork="yes" haltonfailure="no" printsummary="yes">
<classpath refid="testcase.path" />
<!-- <classpath ="${test.classpath}"/> -->
<batchtest todir="${test.reportsDir}" fork="true">
<fileset dir="${test.dest}">
<!--include name="tests/LoginTest.class" />
<include name="tests/Parameterized_Test.class" />
<include name="tests/TestApplication.class" /-->
<include name="testcases/CustomProjectRunner.class" />
</fileset>
Instructor
Ashish Thakur Replied on 08/05/2020
Firstly install JDK 8
I guess you have JDK 9
I have Java version 14 (screenshot attached)
The program will not run with this version?
What can be done to run the program with this version 14?
Instructor
Ashish Thakur Replied on 11/05/2020
Ammy,
Selenium officially supports JDK. Not 14
thats why I am asking you