ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ognjen Blagojevic <ogn...@etf.bg.ac.yu>
Subject Java task, classpath problem
Date Fri, 10 Aug 2007 10:21:20 GMT
Hi,

Can someone try to explain this behavior of java ant task:

   <target name="test1">
     <java classname="com.sun.xml.internal.bind.v2.ContextFactory"/>
   </target>

gives:

   java.lang.NoSuchMethodException: (...)ContextFactory.main

Which is what I expected. ContextFactory is class in JRE's lib rt.jar, 
java task can find it, but it does not have main method. However, this task:


   <path id="emptyClasspath">
   </path>	
	
   <target name="test2">
     <java
       classname="com.sun.xml.internal.bind.v2.ContextFactory"
       classpathref="emptyClasspath"/>
   </target>

gives

   Could not find com.sun.xml.internal.bind.v2.ContextFactory.
   Make sure you have it in your classpath

Now, I expect when I put classpathref attribute in java task, that JRE 
lib is still in the classpath, but it seems that this is not the case. 
(?) Ant cannot find ContextFactory anymore.

Is this a bug?

I use latest released Ant (1.7.0) and Java (1.6.0_02)


Regards,
Ognjen


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


Mime
View raw message