File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Error running javac.exe compiler Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Error running javac.exe compiler" Watch "Error running javac.exe compiler" New topic
Author

Error running javac.exe compiler

Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1291

Hi Ranchers,

I'm using Eclipse Version: 3.4.2 in my machine.
Jdk version "1.6.0_12".
Apache Ant version 1.7.1 compiled on June 27 2008

At the time of run Ant script inside eclipse I am getting this error..
E:\workspace\myproject\build.xml:230: Error running javac.exe compiler

however when I run this Ant from command prompt it run fine.
any Idea why this error is occur ?

Thanks in Advance.


Saifuddin..
[Linkedin] How To Ask Questions On JavaRanch My OpenSource
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 23616

Muhammad,
Eclipse uses different Ant variable values. Check in your workspace to see if javac 1.6 is in the path.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Certs: SCEA Part 1, Part 2 & 3 & Core Spring 3, OCAJP
Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 167
I had the same problem. The solution is to add JAVA_HOME/bin to your PATH.

Here are the steps for Windows:

- Right click "My Computer" and go to "Properties"
- Select the "Advanced" tab
- Hit "Environment Variables" button
- Make sure you have an entry for JAVA_HOME. It points to the path where you installed the JDK.
- Append to the PATH: ;%JAVA_HOME%/bin

On Linux/Unix, edit .bash_profile:

export JAVA_HOME=/usr/local/jdk1.6.0_03
export PATH=${PATH}:${JAVA_HOME}/bin

Note: If you have multiple JRE/JDKs installed, you may need to move this entry earlier in the PATH.

This should also fix the <javadoc> task.

Good luck,
Geoffrey


Sun Certified Programmer for the Java 2 Platform
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1291


Ahh.. I got your point.
Thanks for your help guys.
 
 
subject: Error running javac.exe compiler
 
Threads others viewed
Ant not working in Eclipse
Ant, Eclipse, Jikes
Error running javac.exe compiler
Error running javac.exe compiler
Ant: Error running javac compiler
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture