Eclipse Ant Java_home Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers java_home does not point to the jdk eclipse or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x com.sun.tools.javac.main jar Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it
Eclipse Set Java_home
only takes a minute: Sign up Ant “JAVA_HOME does not point to the JDK” - but it does up vote 11 down vote favorite 3 I cannot run my Ant build.xml since I updated to java 1.7.0_52 (or there
Perhaps Java_home Does Not Point To The Jdk Linux
about). I have been running it for years through Eclipse locally on my Windows 7 laptop - but with this latest jave jdk update somethings different (?). BUILD FAILED C:\workspace\WaterAspectsModel3\build.xml:329: 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. It is currently set to "D:\Morten\Java\jdk1.7.0_52" This is my jdk! So JAVA_HOME is pointing to a jdk (as is also clear from the error message). I have my JAVA_HOME with ant java_home is not defined correctly bin folder in my path as always. I've configured Eclipse - external tools configuration - with a JRE pointing to the same D:\Morten\Java\jdk1.7.0_52 (through "Separate JRE" setting). And I've tried a number of other configurations - all without luck. I've been reading the tonnes of answers on lists here and other places and think I've tried all suggestions. Most seem to be cases where JAVA_HOME actually points to a jre and just needs to be corrected to jdk or there's a ";" in the path or something like that. None of these seem to apply in my case. Any suggestions? eclipse ant java share|improve this question edited Mar 27 at 4:12 Undo♦ 18.4k157399 asked Feb 26 '13 at 20:06 Morten Grum 3001311 Do you have your ANT_HOME environment variable set? Is it also in PATH? That is system path. –Sotirios Delimanolis Feb 26 '13 at 20:15 How about printouts for java -version and javac -version from your lovely cmd.exe? And also what does JAVA_HOME tell you there? –sjas Feb 26 '13 at 20:20 Try ant -version as well. –Sotirios Delimanolis Feb 26 '13 at 20:21 Try the following command in a terminal: "%JAVA_HOME%\bin\javac". If the command does not exist that proves you don't have a JDK installed. –Mark O'Connor Feb 26 '13 at 20:51 add a comment| 5 Answers 5 active oldest votes up vote 4 down vote accepted The
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack
The Archive Tools.jar Which Is Referenced By The Classpath Does Not Exist
Overflow the company Business Learn more about hiring developers or posting ads with us error running javac.exe compiler Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community change java_home of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Set $JAVA_HOME in eclipse but ANT Cannot Find Java Compiler up vote 5 down vote favorite http://stackoverflow.com/questions/15098258/ant-java-home-does-not-point-to-the-jdk-but-it-does I add this line to /home/{user}/.bashrc file: export JAVA_HOME=/usr/lib/jvm/java-6-openjdk but when I want to run an ant file in eclipse got this error: BUILD FAILED /home/bakish/Work/new/hadoop-0.20.2/build.xml:316: 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. It is currently set to "/usr/lib/jvm/java-6-openjdk/jre" what should I do? Thanks eclipse ant java-home share|improve this question edited Sep 2 '15 at 21:18 asked Mar http://stackoverflow.com/questions/5297146/set-java-home-in-eclipse-but-ant-cannot-find-java-compiler 14 '11 at 10:05 Shahryar 6501627 don't forget to vote up the answer if it helped you –Alex_M Mar 14 '11 at 10:13 add a comment| 1 Answer 1 active oldest votes up vote 9 down vote accepted go to preferences / java / installed jre's -> add a new jre and select the location of your jre/jdk share|improve this answer answered Mar 14 '11 at 10:10 Alex_M 936717 1 It works, but if I add ANT jar files to jre/jdk it give same error –Shahryar Mar 14 '11 at 10:18 1 -> windows / preferences / ant / runtime -> add jars –Alex_M Mar 14 '11 at 10:20 1 you forgot to vote up!!! –Alex_M Mar 14 '11 at 12:10 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged eclipse ant java-home or ask your own question. asked 5 years ago viewed 9332 times active 1 year ago R
Things LocationTech Long-Term Support PolarSys Science OpenMDM More Community Marketplace Events Planet Eclipse Newsletter Videos Participate Report a Bug Forums Mailing Lists Wiki IRC How to Contribute Working Groups Automotive Internet of Things LocationTech Long-Term https://wiki.eclipse.org/FAQ_Why_can't_my_Ant_build_find_javac%3F Support PolarSys Science OpenMDM Toggle navigation Breadcrumbs Home Eclipse Wiki FAQ Why can't http://superuser.com/questions/148899/set-java-home-in-windows-but-ant-build-still-fails my Ant build find javac? Log in Jump to: navigation, search ---Navigation---Main PageCommunity portalCurrent eventsRecent changesRandom pageHelpNavigation Main Page Community portal Current events Recent changes Random page Help ---Toolbox---Page informationPermanent linkPrintable versionSpecial pagesRelated changesWhat links hereToolbox Page information Permanent link Printable version Special pages Related changes What links here Page Discussion View source does not History FAQ Why can't my Ant build find javac? Ant tasks that include the javac task for compiling Java source will fail if a Java compiler cannot be found. This results in an error message like the following: 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 This simply means that Ant could not find a java_home does not Java compiler. The easiest solution is to make sure that tools.jar, which is included with any JDKas opposed to a JREis on Ants classpath. You can add items to Ants classpath from the Ant > Runtime preference page. If you launch Eclipse by using a full JDK instead of a JRE, tools.jar should appear on the Ant classpath automatically. Alternatively, Ant supports the notion of a compiler adapter, allowing you to plug in your own Java compiler, such as the Java compiler that is built into Eclipse. The Eclipse compiler adapter is found in the org.eclipse.jdt.core in jdtCompilerAdapter.jar. Again, you need to make sure that this JAR is on Ants classpath from the Ant preference page. Then, simply add the following line to your build file to specify the compiler:
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top set JAVA_HOME in windows but “ant build” still fails up vote 0 down vote favorite 3 I've set JAVA_HOME in my Windows environment preferences: echo %JAVA_HOME% C:\Program Files (x86)\Java\jdk1.6.0_20 However whenever I try to run ant build I get the following: Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre6" I think the registry key JAVASOFT is interfering with my environment variable, but I'm not sure. Any ideas how to fix this? windows-7 windows java environment-variables share|improve this question edited May 10 '11 at 8:26 8088 12.4k113554 asked Jun 4 '10 at 18:07 patrickinmpls 69331333 add a comment| 4 Answers 4 active oldest votes up vote 2 down vote JAVA_HOME should be set to C:\Program Files\Java in the Command Prompt. You can do this with the following: set JAVA_HOME=C:\Program Files\Java This will then look for the most current jdk, lib, jre installed on your system. share|improve this answer edited May 10 '11 at 8:23 8088 12.4k113554 answered May 9 '11 at 17:55 j4mt 212 add a comment| up vote 1 down vote accepted I needed to copy the Tools.jar file from the jdk/lib folder to the jre/lib folder. share|improve this answer edited May 10 '11 at 8:25 8088 12.4k113554 answered Jun 4 '10 at 18:32 patrickinmpls 69331333 > I needed to copy the Tools.jar file from the jdk/lib folder to the > jre/lib folder. Nice , it works !!! but just I want to know why ? why this does it work ? –user100995 Oct 11 '11 at 9:49 add a comment| up vote 1 down vote OK, guys, for Windows 7 it needs the JAVA_HOME as a Windows Environmental Variable, I've also added C:\Program Files\Java\jdk1.7.0_03\ and C:\Program Files\Java\jdk1.7.0_03\bin to PATH, restarted Eclipse, now it works Also - when javac refers to java classes from the JDK, it needs the main SDK folder, not the bin, the bin is only for the javac.exe, while the main folder has \include\ and