Java command line options


The following options are automatically parsed and available from the command line.

Usage:

java [all java/JVM options here] -cp “[path to JCOBridge.jar];[classPath]” yourJavaClass [–NativePath:][–LicensePath:] [–CoreCLRRID:] [–CoreCLRPath:] [–CoreCLRApp:]

--NativePath:“PATH”               The path where is located JCOBridge runtime. Default is the same folder of JCOBridge.jar
--LicensePath:“PATH” The path where is located the JCOBridge license file or, starting from version 2.5.*, the URL of the license
--CoreCLRRID: The Rid to use. Searched autmatically, using some system infos. Set it to override searched value
--CoreCLRPath:"Path" The fully qualified location of the coreclr library from JCOBridge < 2.6.*
--CoreCLRApp:"Framework" The "Framework" to be used from JCOBridge < 2.6.*; valid values are:
- Microsoft.NET5.App (Default), Microsoft.NETCore.App or Microsoft.WindowsDesktop.App (version < 2.5.*)
- Microsoft.NET6.App, Microsoft.NET8.App (Default) or Microsoft.WindowsDesktop.App (2.5.* <= version < 2.6.*)
--CoreCLRVersion:"Version" The "Version" to be used from JCOBridge > 2.6.*; valid values are 8 (Default), 9
--CoreCLREnableDesktop Set on command-line to inform JCOBridge > 2.6.* to enable .NET Desktop applications

Version 2.5.*+

Starting from version 2.5.* it is possible to use environment variables to set the previous variables, they are parsed from the engine in the same way. The standard behavior is to prepend the name of the command-line option with JCOBRIDGE_, e.g. the command line switch LicensePath becomes JCOBRIDGE_LicensePath

Usage Example (from JCOBridge-Examples):

java -cp “../../CLR/OutputCore/net6.0-windows/JCOBridge.jar;./Output” AWTWinFormsWPFNET5 –CoreCLRApp:Microsoft.WindowsDesktop.App

Code snippet to be used:

import org.mases.jcobridge.*;

public class yourJavaClass {
	public static void main(String args[]) {
		try {
				try {
					JCOBridge.Initialize(args);
				} catch (JCException e) {
					e.printStackTrace();
				}
// all stuff

		} catch (JCException jce) {
			jce.printStackTrace();
		}
	}
}