Main Content

Java Package Basics

Integrate MATLAB® generated Java® packages into applications

Integrating compiled MATLAB functions into a Java application is similar to using any standard Java package. The main difference is that the generated functions require that data be passed as MWArray objects.

Functions

compiler.build.javaPackageCreate Java package for deployment outside MATLAB
compiler.build.JavaPackageOptionsOptions for building Java packages
mcrinstallerDisplay version and location information for MATLAB Runtime installer corresponding to current platform
mcrversionReturn the MATLAB Runtime version number matching the version of MATLAB

Examples and How To

Integrate a Java Package into an Application

Example illustrating how to integrate a MATLAB generated Java package with a Java application.

Display a MATLAB Plot in a Java Application

Example illustrating how to incorporate a MATLAB function that generates a graphic in a Java application

Pass Java Objects to MATLAB

Example illustrating how to pass Java objects such as MWJavaObjectRef to a MATLAB generated Java package

Use Multiple Packages in Single Application

Discussion on using multiple MATLAB generated Java packages in a single application

Supply Run-Time Profile Information for Parallel Computing Toolbox Applications

Example illustrating how to use MATLAB Runtime User Data Interface to specify profile information for Parallel Computing Toolbox™ applications.

Concepts

Configure Your Java Environment

Configure the Java environment for compilation of MATLAB code and development of Java applications.

MATLAB Compiler SDK and the JVM

Discussion of the interaction between the Java packages generated by MATLAB, MATLAB Runtime, and the JVM.

Data Conversion Between Java and MATLAB

Information on how data conversion between Java and MATLAB occurs

Pass Arguments To and From Java

Information on how to exchange argument data types between MATLAB and Java

Pass Java Objects by Reference

Information on passing Java objects by reference with MWJavaObjectRef

Manage MATLAB Resources

How to free memory used by the MWArray data conversion classes

Deployable Archive Embedding and Extraction

Manage deployable archive embedding and extraction behavior using either the MWComponentOptions class or environment variables

Ensuring Multi-Platform Portability

Learn how to ensure platform independence if your compiled MATLAB code contains MEX files

Execution of Applications that Create Figures

Example illustrating usage of waitForFigures in developing a console-based Java application that generates MATLAB figures

Work with MATLAB Image Data

Techniques to effectively working with figure and image data