you have to include the jars inside your path, not the directory.
<target name="main">
<java classname="Test">
<classpath><fileset dir="." includes="*.jar"/></classpath>
</java>
</target>
Jan
>-----Ursprüngliche Nachricht-----
>Von: nathan le [mailto:[EMAIL PROTECTED]
>Gesendet: Montag, 8. August 2005 23:48
>An: [email protected]
>Betreff: [Ant 1.6.5] -classpath problems
>
>Hi,
>
>I couldnt find anything to help me when searching the archives/bug DB
>
>I am trying to add some classpaths but when I try to run ant
>it complains that the jar file cannot be found
>
>I have checked spelling and that the jar file exists
>
>If anyone has had similar problems pls can you help
>
>Cheers
>
>Nate
>
>NB As a test I wrote a java class to load a class and print
>out a message if it fails and then tried to use both the cp
>classpath and lib flags
>
>none work
>
>Figure 1. Test class
>public class Test {
>public static void main(String[] args) {
> Test test = new Test();
> ClassLoader loader =
>test.getClass().getClassLoader();
> try {
>loader.loadClass("org.eclipse.core.launcher.Main");
> }
> catch(ClassNotFoundException ecnf)
> {
> System.out.println("CLASS NOT FOUND");
> }
>}
>
>Figure 2. testBuild.xml
><project name="MyProject" default="main" basedir=".">
>
><target name="main">
><java classname="Test">
><classpath location="."/>
></java>
></target>
>
></project>
>
>Figure 3. update.bat
>SET ANT_OPTS=-cp "E:\IDE\eclipse\eclipse\startup.jar"
>
>ant -buildfile "testBuild.xml" -lib
>"E:\IDE\eclipse\eclipse\startup.jar" -verbose -debug
>
>I need to point to some JARs that hold some java logging
>handlers. Thats the point behind this.
>
>
>
>
>
>___________________________________________________________
>Yahoo! Messenger - NEW crystal clear PC to PC calling
>worldwide with voicemail http://uk.messenger.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED] For
>additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]