This Ant-Target works:
<target name="run">
<java jar="dist/FBChatSoft.jar" fork="true"/>
</target>
so "dist/FBChatSoft.jar" is the correct path to the jar.
But the following target doesn't work. The Path to the *Test.java is also correct.,
<target name="junit" depends="jar">
<mkdir dir="junitreport"/>
<junit printsummary="yes">
<classpath>
<path location="dist/FBChatSoft.jar"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="junitreport">
<fileset dir="src/fbchatsoft/client/" includes="*Test.java"/>
</batchtest>
</junit>
</target>
<target name="junitreport">
<junitreport todir="junitreport">
<fileset dir="junitreport" includes="TEST-*.xml"/>
<report todir="junitreport"/>
</junitreport>
</target>
In the JUnitReport I can read:
PropertiesHelperTest
java.lang.ClassNotFoundException: PropertiesHelperTest at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186)
You can find the whole code at: https://bitbucket.org/michaelkohler/fbchatsoft/src