Skip navigation links

See: Description

Packages 
Package Description
com.mathworks.extern.java
This package provides classes that represent MATLAB struct and cell array datatypes.
com.mathworks.toolbox.javabuilder
This package provides classes that define the rules for data conversion between Java and the MATLAB programming environment.
com.mathworks.toolbox.javabuilder.remoting
Contains utilities for exporting MATLAB components over RMI.

The packages included in javabuilder.jar allow Java programmers to incorporate Java classes created from MATLAB functions into their own Java applications. The classes are produced by MATLAB Compiler SDK, which encapsulates each MATLAB function as a method of a Java class.

NOTE: For more information on MATLAB Compiler SDK, please visit www.mathworks.com.

Functionality overview

The packages included in javabuilder.jar provide the following functionality:

  • Data conversion between Java and MATLAB data types and vice versa
  • Utility classes to enable usage of Java classes created using MATLAB Compiler SDK in Java RMI based applications
  • Porting certain aspects of MATLAB graphics in Web based Java applications

MATLAB Runtime

  • MATLAB Runtime is the collection of platform specific native libraries required to execute MATLAB functions exported by the classes created using MATLAB Compiler SDK.
  • It can be installed by running the MCRInstaller executable. If you install MATLAB, MATLAB Compiler, and MATLAB Compiler SDK, you get MATLAB Runtime automatically. The MCRInstaller executable is only needed when these products are not installed.
  • javabuilder.jar can be found in the $MCR/toolbox/javabuilder/jar directory, where $MCR is the root of either a MATLAB or a MATLAB Runtime installation.

For more information on MATLAB Runtime, please search the knowledge base at the MathWorks support web site.

MATLAB Runtime, javabuilder.jar and native resources

Most, though not all, of the classes included in javabuilder.jar have either direct or indirect dependency on the native libraries included in MATLAB Runtime. Creating the first instance of one of these classes is more time consuming than creating subsequent instances since the native libraries from the MATLAB Runtime are loaded on first use. If the underlying MATLAB code uses any graphics functionality offered by MATLAB, there will be additional overhead involved with loading the graphics libraries during the first instantiation of one of the classes.

The operating system uses the native library path to locate native libraries from MATLAB Runtime. See the following list of environment variable names according to operating system:

Operating System

Environment Variable

Windows

PATH

Linux

LD_LIBRARY_PATH

Macintosh

DYLD_LIBRARY_PATH

For more information on how to set these environment variables to correctly point to MATLAB Runtime, please contact the person who has provided you with javabuilder.jar or visit the MathWorks support web site

Memory management

Due to the dependency on native resources, special attention should be provided to the memory management associated with the instances of classes from javabuilder.jar. Most of these classes are wrappers that encapsulate some native resources. The Java wrapper is smaller than the native resources, which exist outside the control of the Java Virtual Machine (JVM). As a result, the JVM memory manager may not call the garbage collector before the native memory becomes exhausted or badly fragmented. Thus, instances of these classes should be explicitly disposed of as soon as possible by using the appropriate methods provided by those classes. Please refer to the individual packages for more information on the native memory management.

 

© 1994-2017 The MathWorks, Inc. Patents Trademarks