Contenido principal

Deploy to Java Applications Using MATLAB Data API for Java

Integrate packaged MATLAB® functions into Java® applications using the MATLAB Data API for data exchange

MATLAB Compiler SDK™ API for Java provides an interface between Java applications and MATLAB code deployed within those applications. This API enables Java applications to launch MATLAB Runtime instances and evaluate deployed MATLAB functions with arguments. The API supports asynchronous task execution for MATLAB library calls, and leverages modern Java constructs for writing streamlined application code.

MATLAB Compiler SDK API for Java uses the MATLAB Data API for Java to handle the data exchange between a Java application and deployed MATLAB code. For details, see Java Data Type Conversions.

All Java applications created using MATLAB Compiler SDK API for Java and MATLAB Data API for Java can be developed and published across Windows®, Linux®, and macOS platforms. This means it's possible to develop on any one of these platforms and publish to any of the other two.

Apps

Java Package CompilerPackage MATLAB programs for deployment as Java packages (Since R2025a)

Functions

compiler.build.javaPackageCreate Java package for deployment outside MATLAB
compiler.build.JavaPackageOptionsOptions for building Java packages
compiler.build.ResultsCompiler build results object
mcrinstallerDisplay version and location information for MATLAB Runtime installer corresponding to current platform
mcrversionReturn MATLAB Runtime version number that matches MATLAB version

Classes

expand all

com.mathworks.runtime.MatlabRuntime Java class that represents a MATLAB Runtime instance (Since R2026a)
com.mathworks.runtime.ApplicationModeJava enum that specifies the process mode for MATLAB Runtime instance creation (Since R2026a)
com.mathworks.matlab.exceptions.MatlabExecutionExceptionJava exception that indicates an error occurred during MATLAB code execution (Since R2026a)
com.mathworks.matlab.exceptions.MatlabNotAvailableExceptionJava exception that indicates MATLAB Runtime is not available or cannot be launched (Since R2026a)
com.mathworks.matlab.exceptions.UnsupportedTypeExceptionJava exception that indicates an unsupported data type in Java to MATLAB data conversion (Since R2026a)

Topics

Requirements

Create and Integrate

Data Mapping

  • Java Data Type Conversions
    The MATLAB engine API provides mappings to pass Java data types to MATLAB and pass MATLAB data types to Java, including Java classes to accommodate MATLAB handle objects, cellstrs, structures, and complex arrays.