Redian新闻
>
ant javac error in eclipse 3.0?
avatar
ant javac error in eclipse 3.0?# Java - 爪哇娇娃
c*t
1
I was able to launch ant view, but when I tried to compile things,
the following error occurred
Buildfile: E:\pjcvs\build.xml
eclipse:
init:
compile:
[javac] Compiling 257 source files to E:\pjcvs
BUILD FAILED: E:\pjcvs\build.xml:33: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
Total time: 3 seconds
Eclipse 2.1x also had similar problem, but I forgot the necessary
fix (setting variable?) Anyone can help?
Thank
avatar
w*r
2
put CLASSPATH in your build script, or ant script.

【在 c*****t 的大作中提到】
: I was able to launch ant view, but when I tried to compile things,
: the following error occurred
: Buildfile: E:\pjcvs\build.xml
: eclipse:
: init:
: compile:
: [javac] Compiling 257 source files to E:\pjcvs
: BUILD FAILED: E:\pjcvs\build.xml:33: Unable to find a javac compiler;
: com.sun.tools.javac.Main is not on the classpath.
: Perhaps JAVA_HOME does not point to the JDK

avatar
w*a
3
我用的是jikes.

Put jikes.exe in the PATH.
javac 太慢了.
我在2.1下面不能rmic, 也是说什么和JAVA_HOME有关. 但是3.0没有问题.

【在 c*****t 的大作中提到】
: I was able to launch ant view, but when I tried to compile things,
: the following error occurred
: Buildfile: E:\pjcvs\build.xml
: eclipse:
: init:
: compile:
: [javac] Compiling 257 source files to E:\pjcvs
: BUILD FAILED: E:\pjcvs\build.xml:33: Unable to find a javac compiler;
: com.sun.tools.javac.Main is not on the classpath.
: Perhaps JAVA_HOME does not point to the JDK

avatar
c*t
4
I found several solutions to it for 2.11
http://www.mjwall.com/node/view/134
the first setting property using build.compiler didn't work for
3.0 for some reason. JDTCompilerAdapter is in plugin directory..
So, I opted to add tools.jar to the runtime classpath of Ant.

【在 w*r 的大作中提到】
: put CLASSPATH in your build script, or ant script.
avatar
c*t
5
I think that Eclipse use Jikes by default, so normally when I
edit and save in Eclipse, it will automatically compile it
for me anyways. So, most of the time my build.xml just do
the jaring.
Dunno if Jikes does any optimizations or not, but I know javac
doesn't do any :(

【在 w*****a 的大作中提到】
: 我用的是jikes.
:
: Put jikes.exe in the PATH.
: javac 太慢了.
: 我在2.1下面不能rmic, 也是说什么和JAVA_HOME有关. 但是3.0没有问题.

avatar
m*t
6
Did you try setting JAVA_HOME to a JDK instead of a JRE?
I have been using Eclipse 3.0 milestone builds for a few months
and have never got this problem.

【在 c*****t 的大作中提到】
: I think that Eclipse use Jikes by default, so normally when I
: edit and save in Eclipse, it will automatically compile it
: for me anyways. So, most of the time my build.xml just do
: the jaring.
: Dunno if Jikes does any optimizations or not, but I know javac
: doesn't do any :(

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。