This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Locate Native Method Libraries

Java® classes can dynamically load native methods using the Java method java.lang.System.loadLibrary("LibFile"). To load the library file LibFile, the folder containing it must be on the Java Library Path. The JVM™ software defines this path at startup.

You can augment the search path for native method libraries by creating an ASCII text file named javalibrarypath.txt in your preferences folder. Follow these guidelines when editing this file.

  • Create the file.

    edit javalibrarypath.txt
  • Specify each new folder on a line by itself.

  • Specify only the folder names, not the names of the DLL files. The System.loadLibrary call reads the file names.

  • In cross-platform environments, simplify the specification of folders by using the $matlabroot, $arch, and $jre_home macros.

You also can create a javalibrarypath.txt file in your MATLAB® startup folder. To identify the startup folder, type pwd at the command line immediately after starting MATLAB. Libraries specified in the javalibrarypath.txt file in the startup folder override libraries specified in the file in the preferences folder.

To disable using the javalibrarypath.txt file, start MATLAB with the -nouserjavapath option.

See Also

Related Topics