Ant Error Com.sun.tools.javac.main Is Not On The Classpath
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta com.sun.tools.javac.main jar Discuss the workings and policies of this site About Us Learn com.sun.tools.javac.main is not on the classpath linux more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack
Java_home Does Not Point To The Jdk Android Studio
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you,
The Archive Tools.jar Which Is Referenced By The Classpath Does Not Exist
helping each other. Join them; it only takes a minute: Sign up Unable to find a javac compiler com.sun.tools.javac.Main is not on the classpath error up vote 2 down vote favorite 1 I am trying to run java application and I am getting following error, Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. ant java_home Perhaps JAVA_HOME does not point to the JDK I have gone through many SO questions and found solution is JAVA_HOME should be point to JDK, not JRE. Then I have tried to print JAVA_HOME in command prompt, I had set this JAVA_HOME from my computer->properties->env variables -> system vars as below, I had also added new variable in eclipse using preferences as, And finally I am still getting the same error. Whats wrong with JAVA_HOME ? Update : In eclipse-preferences-installed jres there is only one entry is present and which is jdk and selected, And under project properties java build path-libraries there is JRE System Liberary [jdk1.8.0_31] is used. Update 1 : C:\Program Files\Java\jdk1.8.0_31 have folder named jre. Is that jre folder causing this issue ? Can I remove this folder ? Is there is any way to add only jdk liberary in project ? java eclipse classpath share|improve this question edited Apr 16 '15 at 13:27 asked Apr 16 '15 at 8:06 fledgling 1,79611943 Pleas confirm wh
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Ant Java_home Is Not Defined Correctly
and policies of this site About Us Learn more about Stack Overflow eclipse set java_home the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation unable to find a javac compiler centos Tags Users Badges Ask Question x 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 http://stackoverflow.com/questions/29668849/unable-to-find-a-javac-compiler-com-sun-tools-javac-main-is-not-on-the-classpath 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 about). I have been running it for years through Eclipse locally on my Windows 7 laptop - but with this latest http://stackoverflow.com/questions/15098258/ant-java-home-does-not-point-to-the-jdk-but-it-does 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 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.3k147298 asked Feb 26 '13 at 20:06 Mo
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 https://wiki.eclipse.org/FAQ_Why_can't_my_Ant_build_find_javac%3F Internet of Things LocationTech Long-Term Support PolarSys Science OpenMDM Toggle navigation Breadcrumbs Home https://www.youtube.com/watch?v=wTgI-b1NDrA Eclipse Wiki FAQ Why can't 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 is not Related changes What links here Page Discussion View source 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 com.sun.tools.javac.main is not not point to the JDK This simply means that Ant could not find a 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: