Java Settings

[JAVA]
classpath = Semi-colon or new line delimited list of jars. May include wildcards.
java_opts = Semi-colon or new line delimited list of Java options.
java_home = Optional path to the installation of Java to use.
library_path = Optional semi-colon or new line delimited list of native library folders.
jvm_dll = Optional filename of the jvm.dll file to load.
jni_version = Optional JNI version to use (defaults to 1.6).

The Java settings determine which Java runtime to use and some Java settings.

classpath

The classpath needs to be set for Jinx to be able to load any classes containing Excel functions. It should be set to a list of jar files (either semi-colon separated or with each path on a new line), and may use * as a wildcard. For example,

[JAVA]
classpath =
    C:/MyJavaProject/artifacts/my_java_project.jar
    C:/MyJavaProject/dependencies/*.jar

Relative paths can be used in the classpath, relative to the jinx.ini file.

java_opts

These are the options used when initializing the JVM. For details about these options please refer to the documentation of the JVM you are using. Typical usage of these options includes specifying the Java heap size and debugging options.

For example, the following sets the initial heap size to 64Mb, the max heap size to 256Mb and enables remote debugging so a debugger can attach to Excel on port 5005 and step through Java code:

[JAVA]
jvm_opts =
    -Xms64Mb
    -Xmx256Mb
    -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

java_home

java_home should be set to the path of the Java runtime you wish to use.

If this is not set then the system default Java runtime will be used.

The java_home path can be a relative path, relative to the jinx.ini file.

library_path

New in Jinx 2.4.1

library_path can be set to a list of paths containing any native *.dll libraries that are loaded by your classes or dependencies. The paths can be relative paths, relative to the jinx.ini file.

This is used by Jinx’s class loader when loading native libraries using System.loadLibrary and can be used as an alternative to setting -Djava.library.path as a global JVM option.

Unlike the -Djava.library.path JVM option, paths specified using this new setting can be relative paths (relative to the jinx.ini file).

jvm_dll

This almost always doesn’t need to be set. The jvm.dll file is what Jinx uses to embed Java into Excel and is found automatically from the Java home directory. In rare cases it may be desirable to explicitly set the full path of the jvm.dll file to load.

jni_version

This almost always doesn’t need to be set. If you are using Java classes that use JNI this option can be used to set the JNI version set when initializing the JVM and attaching the JVM to threads. By default it is set to 1.6.