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
=value
value
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.opts
file in the startup folder, then MATLAB checks the
folder.matlabroot
/bin/arch
matlabroot
is the output of thematlabroot
function.arch
is the output of the MATLABcomputer('arch')
function, for exampleglnxa64
.A
java.opts
file 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
-jdb
command. For information, seematlab (Linux)
ormatlab (macOS)
.To adjust the Java heap size on desktop versions of MATLAB, use Java Heap Memory Preferences.
To modify the static Java class path, create a
javaclasspath.txt
file. For information, see Static Path of Java Class Path.To modify the library path, create a
javalibrarypath.txt
file. For information, see Locate Native Method Libraries.To override built-in options that MATLAB specifies to Java at startup. Options in
java.opts
are 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)