ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Hatton" <>
Subject RE: java task
Date Wed, 05 Nov 2003 09:01:01 GMT
Hi Priyapravas,
At a guess this has something to do with Ant's classloaders.
When you use fork=true, Ant starts a new VM with a straightforward classpath setting.
When you use the <java> task without forking, some classes may be invisible because
of the classloading mechanism (don't ask me about the details :)).
As a rule, I would say fork=true is good, unless your app is really simple.
Hope this helps

-----Original Message-----
From: Priyapravas []
Sent: 05 November 2003 07:43
To: Ant Users List
Subject: java task

I tried executing the java task from within ant. The target looked something like this: 

<target depends="init" name="execute"> 
<java classname="<name_of_the_class_to_execute>"> 
<classpath refid="project.class.path"/> 

On executing this target I got the following error: 

[java] javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl
not found 

Now, I added the attribute fork="true" to the java task element. 

<target depends="init" name="execute"> 
<java classname="<name_of_the_class_to_execute>" fork="true"> 
<classpath refid="project.class.path"/> 

I was able to execute the java task. Can anyone explain this? 


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message