ant-user mailing list archives

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

> -----Original Message-----
> From: Oliver Schalch [] 
> Sent: Monday, 3 April 2006 11:49 PM
> To:
> 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; 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.  


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message