Compile a NetBeans project from the command line with Ant

I have a NetBeans project that I would like to compile from the command line. There are many other questions about StackOverflow about how to do this, but they explain how to compile a project using type commands javac src/*.java.

I have not changed the build settings of the NetBeans project. By default , how can I compile my project from the command line using Ant? As soon as I built my project, where is the compiled file, and in what format is it (for example, .class files, one .jar file, etc.)?

(I understand that the question of how to use Ant to compile my project as a whole is too broad in the question. That is why I ask the question of how to compile using the NetBean default configuration for the project.)

I am using NetBeans 8.0.2.

+4
source share
2 answers

ant compile Compiles the project (.class files are placed in the build / classes folder)

ant jar Compiles the project (see above) and creates a JAR (located in dist /)

If this does not work, check the antoutput for errors. (Is the JAVA_HOME parameter set correctly?)

+4
source

I am a fully agnostic IDE developer. After several disappointing years trying to bring "netbeans ant config" to something that can be used from the command line, I began to create a wrapper for netbeans ant.

https://github.com/albfan/ant-netbeans

:

$ant tab tab

  • JDK_HOME

  • all ant , , , .
+2

All Articles