axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ajith Ranabahu <ajith.ranab...@gmail.com>
Subject [Axis2] problem with using the Ant Javac programmatically
Date Tue, 09 Aug 2005 05:37:18 GMT
Hi all,
I am writing an end to end test case for the code generator. To compile the 
generated code I use the Javac task from Ant. However I 've come across some 
problems, specially a weird problem where the 'java.home' appears to be 
pointing to the Java runtime instead of the JDK home.
Here are the details of the problem
I've used the Javac class (from Ant) to run the compiler. When I run the 
compiler I get an error message saying "Unable to find compiler, Perhaps the 
JAVA_HOME is pointing to the correct place". I've gone through the Javac 
code and then figured out that the compiler is searched using the 'java.home' 
directory. Strangely I have my JAVA_HOME pointed to c:\java\jdk1.4 but the '
java.home' system property points to the c:\java\jdk1.4\jre directory (where 
there is no reference to the tools.jar) and the compile task fails miserably 
:(. I did some tests and figured that the value of the java.home system 
property changes according to the environment you run java !
Currently the compile code is commented. 
Any pointer is appreciated

Thanks
-- 
Ajith Ranabahu

Mime
View raw message