Using the command-line version of NativeJ

Under most situations, there is no need to regenerate the executable as long as your project parameters remain the same. However, certain projects mandates the generation of executables during the build process and prohibit the check-in of EXE files .

We have included a command-line version of NativeJ called nativejc.exe for interfacing with the build process. It takes the project filename as its only parameter, loads the project file, generates the executable, then exits immediately.

Usage: nativejc [-v] <project>

The optional switch -v turns on verbose mode so that more messages are displayed during EXE generation. This may be useful for diagnostic purposes.

Note that if you are using a Java-based build tool such as Ant, make sure that the JAR files you wish to embed into the executable are not located in the classpath. Otherwise, when Ant executes, the instance of java.exe running it will lock all the JAR files in the classpath. Then NativeJ won't be able to access them and will abort with an error.