NXKnowledge

NX Open Programmer's Guide > Execution Methods > Java on Windows

Java on Windows

On Windows, use java.exe:

java -classpath <NX Open Java Libraries> <your class name>
  • <NX Open Java Libraries> — the same libraries included in the javac command used to compile the application.
  • <your class name> — the class name for the corresponding .class or .jar file.

Example (batch Java application using UF wrappers, assuming java.exe is on PATH):

java -classpath ".;%UGII_BASE_DIR%\nxbin\NXOpen.jar;%UGII_ROOT_DIR%\NXOpenUF.jar" <your class name>

Using the -jar Option

java -jar filename.jar takes the JAR file name as the first argument instead of a class name. The JAR's manifest must contain Main-Class: classname, identifying the class with public static void main(String[] args).

When -jar is used, the JAR is the sole source of user classes — other classpath settings are ignored. Instead, the manifest's Class-Path entry is used; list additional jars in relative URL form, space-separated (e.g. myplace/myjar.jar).

To reference NX Open JARs from an NX installation in the manifest:

Class-Path: file:///D:/apps/nx/NX12/NXBIN/NXOpen.jar

See the Oracle Java documentation for more:

Related Topics

  • Executing batch applications overview
  • NX Open for C++
  • NX Open for .NET
  • NX Open for Java
  • NX Open for Python
  • Java on UNIX

Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/genid_java_on_windows_6_646 · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)