获取错误运行javac.exe编译器消息,同时在Eclipse中使用Ant [英] Getting Error running javac.exe compiler message, while using Ant in Eclipse

查看:260
本文介绍了获取错误运行javac.exe编译器消息,同时在Eclipse中使用Ant的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Eclipse中运行Ant构建时,我收到以下错误消息,Ant构建失败。



错误消息:运行javac.exe编译器时出错



构建停止的行



<$ p fork =truememoryinitialsize =512Mmemorymaximumsize =1G> $ p>
< classpath refid =classpath/>
< src path =$ {source.home}/>
< / javac>

以前有人遇到过类似的问题吗?或者有人知道这里有什么问题吗?



系统信息:Eclipse Helio,JDK 1.5

解决方案

我有同样的问题,问题是,在eclipse中java.home指的是JRE而不是JDK。我改变了它,构建是成功的。您可以执行以下操作将其更改为JDK:



首选项> Java>已安装JRE>添加...对于JRE类型,选择标准VM>下一步目录:选择您的JDK目录(而不是JRE)(在我的情况下:C:\Program Files\Java\jdk1.6.0_16),按OK。



现在,你回到'安装的JRE',在这里也选择JDK。



下面的帖子有助于找到解决方案。
JAVA_HOME指向错误的地方


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

解决方案

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

这篇关于获取错误运行javac.exe编译器消息,同时在Eclipse中使用Ant的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆