通过使用Ant命令行编译NetBeans项目 [英] Compile NetBeans project from command line by using Ant
问题描述
我有一个NetBeans项目,我想在命令行编译。对于如何这样做StackOverflow上很多其他的问题,但他们解释如何使用类似的命令来编译项目的javac的src / *。java的
。
I have a NetBeans project I would like to compile from the command line. There are many other questions on StackOverflow about how to do so, but they explain how to compile the project using commands like javac src/*.java
.
我没有改变我的NetBeans项目的构建设置。 默认,我怎么能编译使用Ant的命令行我的项目?一旦我建我的项目,其中编译文件所在,什么格式是它(即.class文件,一是.jar文件,等等)?
I haven't changed my NetBeans project's build settings. By default, how can I compile my project from the command line using Ant? Once I've built my project, where is the compiled file located, and what format is it in (i.e., .class files, one .jar file, etc.)?
(我的理解是问如何使用Ant编译我一般的项目是过于宽泛的一个问题,这就是为什么我专门询问如何使用NetBean的默认配置为一个项目进行编译。)
(I understand that asking how to use Ant to compile my project in general is too broad of a question. That's why I'm specifically asking about how to compile using NetBean's default configuration for a project.)
我使用NetBeans 8.0.2。
I'm using NetBeans 8.0.2.
推荐答案
蚂蚁编译
编译项目(.class文件放置在build / classes文件夹)
ant compile
Compiles the project (.class files are placed in the build/classes folder)
蚂蚁的jar
编译项目(见上文),并建立了一个JAR(位于DIST /)
ant jar
Compiles the project (see above) and builds a JAR ( located in dist/ )
如果不为你工作,检查蚂蚁的
输出错误。 (是JAVA_HOME变量设置是否正确?)
If that doesn't work for you, check ant
's output for errors. (Is the JAVA_HOME Variable set properly?)
这篇关于通过使用Ant命令行编译NetBeans项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!