Getting Error running javac.exe compiler message,

2019-02-01 06:32发布

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 compiler

Line where the build stops:

<javac destdir="${classes.home}" debug="on" fork="true" memoryinitialsize="512M" memorymaximumsize="1G">
        <classpath refid="classpath"/>
        <src path="${source.home}"/>
</javac>

Has anyone faced a similar problem before? or does anybody know what's wrong here?

System Information: Eclipse Helio, JDK 1.5

16条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-02-01 06:48

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

查看更多
乱世女痞
3楼-- · 2019-02-01 06:57

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

查看更多
【Aperson】
4楼-- · 2019-02-01 06:57

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.

查看更多
男人必须洒脱
5楼-- · 2019-02-01 06:58

For me it was backup libs inside WEB-INF/lib directory. I had multiple lib directory inside the main lib. And the classpath was including them all causing the javac command to become too long.

I removed those directories and it worked for me.

查看更多
登录 后发表回答