aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Unable to find a javac compiler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Unable to find a javac compiler" Watch "Unable to find a javac compiler" New topic
Author

Unable to find a javac compiler

Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Hi,
I have an application running on Tomcat 5.5.16 which I deploy using tomcat deployer (5.5.16). This works great. This application then calls tomcat deployer to deploy other application to the same server (I build the configuration file at runtime). But then I get this error:

I've been searching the web for this and tried everything:
- tools.jar is in TOMCAT_HOME/common/lib
- my JAVA_HOME points to the SDK not just the JRE
- I specified the path to tools.jar in the build.xml
- I put tools.jar in the lib directory of tomcat deployer.
I don't know what's going on.. It works when I call the ant task form eclipse but not when I call it fromthe application. Any ideas?
Thaks a lot.
Pablo.


2B || !2B
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Tomcat 5.5 and up ships with it's own compiler.

How did you install Tomcat?
How are you starting it?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Thanks for the reply Ben,
I installed tomcat with the "apache-tomcat-5.5.16.exe". I tried to start it by different means: with the monitor, the exes (tomcat5.exe, tomcat5w.exe), also I'm calling tomcat5.exe from the eclpse, as an external tool to get the output in the console. I always get the same error.
Since tomcat 5.5 has its own compiler, should I skip the compile target of the build.xml and jump directly to the deploy target? If so, how do I create the war?
Thanks again.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This sounds more like an ANT problem than a tomcat issue.
I'm going to move this to our Ant, Maven and other build tools forum.

Did you test your JAVA_HOME environment variable to make sure it's pointed to where you think it is?
[ January 24, 2007: Message edited by: Ben Souther ]
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
What task is failing with this message? Not sure if it would help in this case to run with -v argument to get more verbose output.

We have on occasion added tools.jar to the classpath for tasks like ejbjar so that com.sun.tools.javac.Main can be found. (not the environment classpath we always unset that before running ant these days, just the specific classpath used by a task that needs it).

[Add: using ant 1.6.x and jdk 1.4.2]
[ January 25, 2007: Message edited by: Carol Enderlin ]
Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Thanks for the replies,
The task that fails is javac, inside the compile target of the build.xml that ships with tomcat deployer. We just tried compiling (with the ide) and then calling the deploy target to skip this task. This is working so we can move on... I guess we killed the patient to terminate the disease.
Thanks again, if I find out what was (is, actually) going on I'll post it.
Pablo.
 
wood burning stoves
 
subject: Unable to find a javac compiler