Deploy to Java Applications Using MATLAB Data API for Java
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 Compiler | Package MATLAB programs for deployment as Java packages (Since R2025a) |
Functions
compiler.build.javaPackage | Create Java package for deployment outside MATLAB |
compiler.build.JavaPackageOptions | Options for building Java packages |
compiler.build.Results | Compiler build results object |
mcrinstaller | Display version and location information for MATLAB Runtime installer corresponding to current platform |
mcrversion | Return MATLAB Runtime version number that matches MATLAB version |
Classes
Topics
Requirements
- MATLAB Compiler SDK Java Target Requirements
Refer to the software requirements for using MATLAB Compiler SDK to create Java packages. - Choose Java Deployment Option
Explore Java deployment options that MATLAB Compiler SDK offers and select the right one for your specific Java integration needs. - Set Up Java Development Environment
Set up development environment to develop Java applications containing deployed MATLAB code. - Set MATLAB Library Paths for Testing Deployed Applications
Use libraries from an existing MATLAB installation for testing without requiring a separate MATLAB Runtime installation. - Summary of MATLAB Compiler SDK Java APIs
Explore the various MATLAB Compiler SDK Java APIs.
Create and Integrate
- Package MATLAB Function Using Java Package Compiler App with MATLAB Data API
Create a Java MATLAB Data package using the Java Package Compiler app. - Deploy MATLAB Function to Java Application Using MATLAB Data API for Java
Learn how to package and deploy a MATLAB function to a Java application. - Deploy MATLAB Function That Accepts Struct Array as Input Argument to Java Application
Learn how to package and deploy a MATLAB function that accepts a struct array as input into a Java application. - Deploy MATLAB Class that Inherits from MATLAB Handle Class
Learn how to package and deploy a MATLAB class that inherits from the MATLAB handle class for use in a Java application.
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.