Because the IDE's project commands are based on Ant scripts and properties files, you can run these targets from outside of the IDE as "headless builds." Headless builds for Mobility projects operate under the same principles as for general Java projects. See Chapter 3, Deploying a Java Project Outside of the IDE for more information. Computers with NetBeans IDEAssuming that the project has already been opened in NetBeans on the target computer and no reference problems exist, any Ant target can be invoked from within the project directory. For example, typing ant jar run at a command line will compile, package, and execute the project. As always, Ant properties can be set by using the -D switch. Examine your project's build.properties file to see which properties can be set. Normally, this is used to activate a certain configuration. For example, the following line will run the project using the BigScreenConfig: ant-Dconfig.active=BigScreenConfig run Computers without NetBeans IDERunning NetBeans projects on computers that have no NetBeans IDE installation is somewhat more complicated. It is strongly recommended that projects be opened within NetBeans IDE, as then the IDE can be used to configure the project to work on the new machine. But if this is not possible, you should take the following actions to set up the project:
Once these files have been created, the headless build can be invoked similarly to how it is started on machines with NetBeans installed. The only difference is that the user.properties.file should be set to point to the build.properties file created previously. So, for example, ant-Duser.properties.file=C:\{path}\build.properties jar will build the distribution JAR files of the project. Make sure to use a fully qualified path to the build.properties file. |