Sorry bad example What I am trying to include a jar that holds a java logging handler
I am trying to use java logging on the ant build process I created a listener that uses java logging and have configured the logging system to use a custom handler that is included in a jar I seem to be having trouble including that jar as part of the ant invocation ... if I use -cp or -classpath in ANT_OPTS or -lib flag i still get the same message Can't load log handler "xxxxxxx" java.lang.ClassNotFoundException: xxxxxxx java.lang.ClassNotFoundException: xxxxxxx It seems that java logging has issues with classloaading so am now wondering if this is the problem rather than ant ... or is there a general problem with including jars using the -classpath or -cp flags --- [EMAIL PROTECTED] wrote: > 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] > > ___________________________________________________________ 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]
