Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Call Java Libraries

Access Java® libraries from MATLAB®

You can access existing Java classes to use in the MATLAB workspace. For example, use built-in class packages, such as java.util, which are included in the Java language. See your Java language documentation for descriptions of these packages. You can also access classes defined in individual .class files, packages, or Java Archive (JAR) files, including classes you develop.

Functions

import Add package or class to current import list
isjava Determine if input is Java object
javaaddpath Add entries to dynamic Java class path
javaArray Construct Java array object
javachk Error message based on Java feature support
javaclasspath Return Java class path or specify dynamic path
javaMethod Call Java method
javaMethodEDT Call Java method from Event Dispatch Thread (EDT)
javaObject Call Java constructor
javaObjectEDT Call Java constructor on Event Dispatch Thread (EDT)
javarmpath Remove entries from dynamic Java class path
usejava Determine if Java feature is available

Classes

matlab.exception.JavaException Capture error information for Java exception

Topics

Getting Started

Getting Started with Java Libraries

Requirements for using the MATLAB Java interface.

Java Class Path

Bring Java classes into the MATLAB workspace.

Using Java Libraries

Call Java Method

How to call a method in the Java standard library class java.util.ArrayList.

Call Method in Your Own Java Class

Use the dynamic class path to develop your own Java classes.

Simplify Java Class Names Using import Function

Use the import function to refer to a class by its class name only.

Troubleshooting

Java Heap Memory Preferences

How to adjust the Java heap size.

Executing Java main Methods in MATLAB

How MATLAB handles main methods.

Featured Examples

Was this topic helpful?