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

后端 未结 17 680
旧时难觅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:36

    I removed fork="true" and I got past that piece of code. What might be interesting to those of you who have this problem is that now, at that line, I get the output:

    'Since fork is false, ignoring memoryMaximumSize setting.'
    

    So it may be an issue with memoryMaximumSize if you need to keep your fork="true" setting, as suggested above.

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

    Try changing memorymaximumsize="1G" to memorymaximumsize="512M".

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

    If you are running ant in eclipse click run as --> Ant second option and choose JDK path and run the build again.

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

    We hit the same issue on a windows build machine whereas locally (on a unix machine) everything worked out. Fork = true didnt helped either, it resulted in a Process fork failed exception also only on the build server

    Research

    After some research, we had a clue that the classpath might be too long. We recreated the exact folder structure locally on a windows machine and we hit the same issue and we saw that the classpath was way too long (we used -v and -d for details how long it was) and this was the cause of the error.

    Solution

    The solution was to create a jar, which contains only the manifest with all the libraries, see this answer for more details

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

    I had the same problem and the issue was, in eclipse java.home was referring to JRE instead of JDK. I changed it and the build was successful. You can do the following to change it to JDK:

    Preferences > Java > Installed JRE's > Add... For 'JRE Type' select 'Standard VM' > Next > Directory: select your JDK directory (instead of JRE) (in my case: C:\Program Files\Java\jdk1.6.0_16 ), press OK.

    Now, you are back at 'Installed JRE's', select the JDK here also.

    The below post helped in finding the solution. JAVA_HOME points to the wrong place

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

    Try to free some main memory. Close memory-hungry programs, and stop memory-hungry processes if you can.

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