Reputation: 32071
I can't see why this Ant task fails:
<javac srcdir="src" destdir="bin" verbose="true" classpath="lib/*;${MyCommons.proj.path}/MyCommons.jar" />
My jars are all in lib, plus one external jar. When I mouse-over the classpath section eclipse shows all the jar files are recognized by this configuration.
On compile, I get 100 errors of can't find this package or symbol (it's not finding the jars).
[javac] Compiling 51 source files to C:\MyProjects\MyCommons\bin
[javac] C:\MyProjects\MyCommons\src\com\proxyandvpn\datamodel\Notification.java:3: package org.joda.time does not exist
[javac] import org.joda.time.DateTime;
[javac] ^
[javac] C:\MyProjects\MyCommons\src\com\proxyandvpn\datamodel\Transaction.java:5: package org.joda.time does not exist
[javac] import org.joda.time.DateTime;
I've tried every format of classpath I can find, classpathref's, embedded , filesets, filelists, , etc. for about an hour.
Does anyone see an error?
Prior to this call I have a call to
<ant target="compile" dir="/some/other/project"/>
Removing this allowed the javac command to compile successfully.
Upvotes: 4
Views: 5847
Reputation: 1630
I had the exact same problem. This helped me:
<ant target="compile" dir="/some/other/project" inheritAll="false"/>
Upvotes: 1
Reputation: 943
you should try this (did not run myself but I think it works):
<path id="some.classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${MyCommons.proj.path}/MyCommons.jar"/>
</path>
and then
<javac srcdir="src" destdir="bin" verbose="true">
<classpath refid="some.classpath"/>
</javac>
If there are errors, put them in comments. I will correct it.
Upvotes: 3