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.

Dynamic Path

MATLAB® segments the Java® class path into a static path and a dynamic path. MATLAB searches the static path before the dynamic path.

MATLAB provides the dynamic path as a convenience for when you develop your own Java classes. You can change class definitions on the dynamic path without restarting MATLAB. Therefore, it is useful to put a user-defined Java class definition on the dynamic path while you develop and debug the class.

While the dynamic path offers greater flexibility in changing the path, Java classes on the dynamic path might load more slowly than classes on the static path. Also, classes on the dynamic path might not behave identically to classes on the static path. If your class does not behave as expected, then use the static path.

After developing a Java class, put the class on the static path. For more information, see Static Path

To add a class to the dynamic path, use the javaclasspath and javaaddpath functions. To remove an entry, use the javarmpath function. These functions clear all existing variables and global variables in the workspace.

Note

Do not put Java classes on the static path if they have dependencies on classes on the dynamic path.

See Also

| |

Related Topics