Adding to Java classpath breaks ant -



Adding to Java classpath breaks ant -

i wanted have jar in classpath easy access jython repl. in .bashrc put:

export classpath=:/home/tmacdonald/path/to/jar/thing.jar

however, breaks ant both compiling jar can compiling jar different subpackage:

$ ant jar invalid implementation version between ant core , ant optional tasks. core : 1.8.0 in file:/usr/share/ant/lib/ant.jar optional: 1.5.1 in file:/home/tmacdonald/path/to/jar/lib/gt2-2.3.3/ant-optional-1.5.1.jar $ echo $classpath :/home/tmacdonald/path/to/jar/thing.jar

changing classpath fixes it:

$ export classpath= $ !ec echo $classpath $ ant jar [compiles successfully.]

but seems awkward , not right thing have maintain changing classpath, depending on whether wanted run ant or jython repl. i'll admit knowledge of both ant , classpath pretty weak. think of classpath being, "path java libraries; or pythonpath java", , ever add together little changes existing ant config files inherited--i've never had set 1 up.

so i'd interested hear what's happening (and incidentally how causes problem) can little bit more educated, , of course of study i'd fix. thanks!

i don't think ant should know or care environment variables. right way set classpath within ant build.xml itself.

here production , test classpaths utilize in ant build.xml files:

<path id="production.class.path"> <pathelement location="${production.classes}"/> <pathelement location="${production.resources}"/> <fileset dir="${production.lib}"> <include name="**/*.jar"/> </fileset> </path> <path id="test.class.path"> <path refid="production.class.path"/> <pathelement location="${test.classes}"/> <pathelement location="${test.resources}"/> <fileset dir="${test.lib}"> <include name="**/*.jar"/> </fileset> </path>

as can see, there no references ${classpath}, nor should there be.

java ant classpath

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -