Specifying Java Startup Options
You can specify custom Java® startup options by creating a java.opts file, a text
file containing one option per line. For example, use the
-D
command to assign a property=valuevalue to a system
property.
Put the java.opts file in one of the following folders:
MATLAB® startup folder, if starting MATLAB from an operating system prompt. For more information, see MATLAB Startup Folder.
If there is no
java.optsfile in the startup folder, then MATLAB checks thefolder.matlabroot/bin/archmatlabrootis the output of thematlabrootfunction.archis the output of the MATLABcomputer('arch')function, for exampleglnxa64.A
java.optsfile in this location applies to all users, but individual users might not have permissions to modify files there.
Do not use a java.opts file in the following situations:
To enable the use of the Java debugger, use the
matlab-jdbcommand. For information, seematlab (Linux)ormatlab (macOS).To adjust the Java heap size on desktop versions of MATLAB, use Java Heap Memory Settings.
To modify the static Java class path, create a
javaclasspath.txtfile. For information, see Static Path of Java Class Path.To modify the library path, create a
javalibrarypath.txtfile. For information, see Locate Native Method Libraries.To override built-in options that MATLAB specifies to Java at startup. Options in
java.optsare appended to the end of the built-in list. Whether these additional options override built-in options is JVM-dependent and can change between Java versions. To see what options MATLAB provides to Java, run this command:java.lang.management.ManagementFactory.getRuntimeMXBean.getInputArguments
See Also
matlab (Linux) | matlab (macOS)