ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: [Ant 1.6.5] -classpath problems
Date Tue, 09 Aug 2005 06:27:54 GMT
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:nathanialle@yahoo.co.uk] 
>Gesendet: Montag, 8. August 2005 23:48
>An: user@ant.apache.org
>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: user-unsubscribe@ant.apache.org For 
>additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message