You can access existing Java classes to use in the MATLAB workspace. For example, use built-in class packages, such asjava.util
, which are included in the Java language. See your Java language documentation for descriptions of these packages. You also can access classes defined in individual.class
files, packages, or Java Archive (JAR) files, including classes you develop.
You can run MATLAB with your system version of the Java Runtime Environment (JRE™). For information about Java versions compatible with MATLAB, seeMATLAB Interfaces to Other Languages. To set the JRE path in MATLAB, calljenv
. To set the path from the operating system prompt, callmatlab_jenv
.
Isjava. |
Determine if input isJavaobject |
javaaddpath |
Add entries to dynamicJavaclass path |
javaArray |
构造Javaarray object |
javachk |
Error message based onJavafeature support |
javaclasspath |
ReturnJava类路径或指定动态路径 |
javaMethod |
CallJavamethod |
javaMethodEDT |
CallJavamethod from Event Dispatch Thread (EDT) |
javaObject. |
CallJavaconstructor |
javaObject.EDT |
CallJavaconstructor on Event Dispatch Thread (EDT) |
javarmpath. |
Remove entries from dynamicJavaclass path |
usejava |
Determine ifJavafeature is available |
jenv |
Set杰瑞Java Runtime Environment path forMATLAB |
matlab_jenv |
Set杰瑞Java Runtime Environment path forMATLABfrom system prompt |
matlab.exception.javaException. |
Capture error information forJava异常 |
Requirements for using the MATLAB Java interface.
将Java类带入MATLAB工作区。
How to call a method in the Java standard library classjava.util.ArrayList
.
Call Method in Your Own Java Class
Use the dynamic class path to develop your own Java classes.
Call Back into MATLAB from Java
How to write Java programs that call into MATLAB from a running MATLAB.
Use theimport
function to refer to a class by its class name only.
Add Java packages to MATLAB static path.
How MATLAB interprets the size, shape, and dimension of a Java array.
How to adjust the Java heap size.
Avoid Calling Java main Methods in MATLAB
How MATLAB handlesmain
methods.