This content has been marked as final. Show 7 replies
I have a
<target name="build" depends="init">
<javac srcdir="$(src.dir)" destdir="$(build.dir)" />
<target name="dist" depends="build">
<jar jarfile="$(dist.dir)/test.jar" basedir="$(build.dir)" />
<target name="runClass" depends="dist">
<java classname="com.test.Test" fork="yes" >
I can run the class Test fine from the cmd line fine, but it contains a paths.properties loaded up in it whose path isn't in the jar. When I open the jar with winzip it looks like:
I presume that's why it's not working in ant??
I'm not avoiding it - I'm trying to understand how to make it work properly!
My class Test is in the the package com.test and when I run the ant build Test.class goes to: build/com/test and the jar goes to the /dist directory.
I can use a copy function that will put the properties file in the build folder but the class still won't run through ant.
Am I missing something simple here? is it easy to get working?
I didnt get your question completely but as far as I understood, your Test.java class is present in the package com.test and you have a properties file which your Test.java access. So in-order to get your Test running successful your properties file path has to used correctly in your code and this properties file should also be present in the class path.
Once you solve these issues it will definately run.
I hope this helps.
Amit Singh Rathore