ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen McConnell" <mcconn...@dpml.net>
Subject RE: Javac tasks (when calling from java)
Date Mon, 03 Apr 2006 17:19:37 GMT
 

> -----Original Message-----
> From: Oliver Schalch [mailto:oliver.schalch@wyona.com] 
> Sent: Monday, 3 April 2006 11:49 PM
> To: user@ant.apache.org
> Subject: Javac tasks (when calling from java)
> 
> Hi List, 
> 
> Another Problem...
> 
> Calling ant from Java (inside a bigger project)
> 
> Unable to find a javac compiler; com.sun.tools.javac.Main is 
> not on the classpath. Perhaps JAVA_HOME does not point to the JDK
> 
> Alright, ofcourse the JAVA_HOME are set correct.
> 
> How could I fix that?
> 
> Do I have to write a own classloader with the tools.jar in 
> it, and use it with project#setClassLoader ?

The application that is calling ant (and specifically the javac task) must
be established within a classloader that either contains tools.jar, or has
access to tools.jar somewhere in the parent classloader chain.  If you have
control over the system classloader then it's reasonably easy to trigger the
automatic loading of tools.jar on application startup.  

/Steve.



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


Mime
View raw message