简体   繁体   English

如何使Eclipse Ant构建器使用Eclipse中内置的编译器?

[英]How do I make the Eclipse Ant builder use the compiler built into Eclipse?

I have an eclipse project which uses an ant script to do some additional build steps, such as building jars. 我有一个eclipse项目,该项目使用ant脚本执行一些附加的构建步骤,例如构建jar。

When someone first imports the project, the ant build fails because it can't find javac in the classpath. 最初有人导入项目时,ant构建失败,因为它无法在类路径中找到javac。 Adding the path to the JDK to JAVA_HOME makes the build work, but I'd rather not have this requirement, and instead just build using the built-in compiler in eclipse. 将JDK的路径添加到JAVA_HOME可以使构建工作正常进行,但我不希望有此要求,而是只使用eclipse中的内置编译器进行构建。

Is there a simple way to configure the project/ant builder to do this? 有没有一种简单的方法可以配置项目/蚂蚁生成器来做到这一点?

You will need to set the ant target to use eclipse compiler... looks pretty complicated, but here you go 您将需要设置ant目标以使用eclipse编译器...看起来很复杂,但是在这里

http://dev.eclipse.org/viewcvs/index.cgi/jdt-core-home/howto/batch%20compile/batchCompile.html?revision=1.4 http://dev.eclipse.org/viewcvs/index.cgi/jdt-core-home/howto/batch%20compile/batchCompile.html?revision=1.4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM