Table of Contents

Command line options

Whenever you compile with JCOBridge, the following options are parsed automatically and are available from the command line of your software.

Option Description
--JCOBridgeHelp Displays the usage help.
--LicensePath:"PATH" Path of the JCOBridge license file.
--JDKHome:"PATH" Path of the JRE of the installed JDK.
--JVMPath:"PATH" Path of the JRE environment, or full path of the JVM library file (jvm.dll / libjvm.so). On Windows, if not set, the library looks for a suitable version on the system.
--JVMClassPath:"PATH" Class path sent to the JVM.
--JVMModulePath:"PATH" Module path sent to the JVM.
--JNIVerbosity:"OPTIONS" Parameters for JNI verbosity, see the Oracle documentation.
--JNIOutputFile:"PATH" Absolute path where the JNI verbose output is written. The file is opened in append mode.
--JVMPackages:"PKG1,PKG2…PKGN" Comma-separated list of package names to use, for example java.lang,java.util.
--JVMOption:OPTION Sets a single option for the JVM when it is created. Escape the text to allow special characters. Repeat it to pass several options, for example --JVMOption:-Xmx128M.
--JVMKVOption:OPTION Sets a key-value (-Dkey=value) option for the JVM. The equal sign splits key and value. Repeat it to pass several options, for example --JVMKVOption:key=value.
--JVMHeapSize:value Heap size (-Xmx) set when the JVM is created.
--JVMInitialHeapSize:value Initial heap size (-Xms) set when the JVM is created.
--JVMJmxPort:value JMX port set when the JVM is created.
--JVMEnableDebug Enables JVM debug.
--JVMDebugPort:value Port used for debug when the JVM is created. Default is 5005.
--JVMDebugSuspendFlag:value Suspend flag used in the debug option. Default is n.
--JVMDebugOpts:value String used in the debug option. Default is -agentlib:jdwp=transport=dt_socket,server=y,suspend={JVMDebugSuspendFlag},address={JVMDebugPort}.
--JVMIgnoreUnrecognized Tells the JVM to ignore unrecognized options.
--JVMDisableOpenOnJavaNio Closes access to the java.nio module, that is, removes --add-opens=java.base/java.nio=ALL-UNNAMED from the JVM parameters.
--JVMEnableNativeAccess Enables native access as defined in JEP 472. Disabled by default for compatibility with JDK 11.

Environment variables

Every option above can also be set with an environment variable, parsed by the engine in the same way. Prepend JCOBRIDGE_ to the name of the option: for example LicensePath becomes JCOBRIDGE_LicensePath.

Important

On Windows, the JCOBRIDGE_JVMPath environment variable takes precedence over JAVA_HOME and the Windows registry. If the JDK/JRE installer sets neither JAVA_HOME nor the registry and you get InvalidOperationException: Missing Java Key in registry: Couldn't find Java installed on the machine, set JCOBRIDGE_JVMPath to the location of jvm.dll.

Usage example

yourSoftware --JVMPath:"C:\Program Files\Java\jre1.8.0_121\bin\server\jvm.dll" --JVMOption:-Xmx128M [your software options]