Getting Error running javac.exe compiler message, while using Ant in Eclipse

后端 未结 17 678
旧时难觅i
旧时难觅i 2020-12-24 13:04

When I run my Ant build in Eclipse, I\'m getting the following error message and the Ant build fails.

Error Message: Error running javac.exe compile

相关标签:
17条回答
  • 2020-12-24 13:32

    I had the same problem and removed the attribute fork from javac and problem was gone.

    0 讨论(0)
  • 2020-12-24 13:34

    Configuring eclipse to point to JDK instead of JRE did not work for me. With further investigation, I solved this problem by stopping the build process from forking. In your build.xml, remove the attribute fork from <javac> tag.

    0 讨论(0)
  • 2020-12-24 13:34

    The accepted answer didn't work for me. But right-clicking in Ant and setting the Java Runtime Environment (JRE) to the Jave Development Kit (JDK) worked for me.

    Abhi Rampal's answer is the step by step the same way I solved the problem on my eclipse.

    Go to Run -> External Tools -> External Tools Configuration -> select your build.xml on the left menu -> select JRE tab -> select the JDK(from the dropdown) for Separate JRE radio button option -> Click Run.

    0 讨论(0)
  • 2020-12-24 13:34

    I solved this by checking my Environment Variables in my Windows 7. I found that JAVA_HOME is pointing to C:\ Program Files (x86)\Java\jdk1.6.0_31 when it supposed be C:\ Program Files\Java\jdk1.6.0_31. If you want to know how read this

    0 讨论(0)
  • 2020-12-24 13:34

    I fixed the problem like this:

    My Java home folder had the wrong path. It should have been C:\Program Files (x86)\Java\jdk1.5.0_15 but instead it was C:\Program Files (x86)\Java\jdk1.5.0_15\bin.

    0 讨论(0)
  • 2020-12-24 13:36

    Maybe the javac problem is because "javac.exe" is not in your System PATH, please edit your system path and add your JDK's /bin directory to it to correct this problem.

    Open a shell or command prompt and try typing: javac to check if the system path is set correctly.

    0 讨论(0)
提交回复
热议问题