eclipse使用ant编译问题

文章介绍了在使用Eclipse Mars版本进行ant编译时遇到的问题,包括找不到main class错误和JRE版本不支持错误的解决方法。通过更改JRE设置为工作空间默认JRE,解决了ant编译问题,并提供了运行Eclipse Mars版本时使用Java 1.6的解决方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

注:eclipse是Mars版本

1.ant编译报Could not find the main class: org.eclipse.ant.internal.launching.remote.InternalAntRunner. Program will exit.错误


I just installed Mars and when I tried to execute a build.xml after checking out an existing and working project I got that error message:Could not find the main class: org.eclipse.ant.internal.launching.remote.InternalAntRunner. Program will exit.

The solution is to go to Run as → External tools configuration… → JRE where the default was set to “Separate JDK”: jdk1.6.0_31 (I had set up JDKs 6-8 in Preferences after installing). I changed this to “run in the same JRE as the workspace” and now it works.

Bug fix would be to provide a working default configuration with setup. Configuration should be in a way it does not break if the user adds additional JDKs to Preferences.


原文地址:https://bugs.eclipse.org/bugs/show_bug.cgi?id=472599


2.ant编译报JRE version less than 1.7 is not supported错


解决方法:http://stackoverflow.com/questions/31052878/run-eclipse-mars-with-java-1-6

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值