Java 패키지 연동
컴파일된 MATLAB® 함수를 Java® 애플리케이션에 연동
MATLAB Compiler SDK™를 사용하여 컴파일된 MATLAB 함수를 Java 애플리케이션에 연동하려면 MATLAB Runtime을 초기화하는 API, 컴파일된 MATLAB 함수를 MATLAB Runtime으로 로드하는 API, Java와 MATLAB 사이의 데이터 전달을 관리하는 API를 조합해서 사용해야 합니다.
Java 패키지와 애플리케이션은 대규모 엔터프라이즈 환경이나 웹 환경의 애플리케이션을 위한 이식 가능하고 확장 가능한 솔루션을 제공합니다. 생성된 패키지를 MATLAB Runtime이 설치된 엔터프라이즈 환경이나 웹 환경에 배포할 수 있습니다.
Java 원격 메서드 호출(RMI)은 Java 객체가 다른 Java 가상 머신(JVM)에서 실행되는 객체를 호출할 수 있도록 하는 API 세트입니다. 클라이언트-서버 애플리케이션, 분산 애플리케이션, 웹 애플리케이션을 개발하려면 RMI를 사용하십시오. 이러한 애플리케이션의 경우 MATLAB 함수를 직접 호출하는 애플리케이션의 일부만 MATLAB Runtime이 필요합니다. 애플리케이션의 다른 부분은 네이티브 Java 데이터형을 사용하여 작업할 수 있습니다.
함수
compiler.build.javaPackage | Create Java package for deployment outside MATLAB (R2021a 이후) |
compiler.build.JavaPackageOptions | Options for building Java packages (R2021a 이후) |
compiler.build.Results | Compiler build results object (R2020b 이후) |
mcrinstaller | 현재 플랫폼에 해당하는 MATLAB Runtime 인스톨러의 버전과 위치 정보 표시 |
mcrversion | MATLAB 버전과 매칭되는 MATLAB Runtime 버전 번호 반환 |
Java API 문서
클래스
도움말 항목
요구 사항 및 주요 내용
- Requirements and Limitations of MATLAB Compiler SDK Java Target
Refer to the software requirements for using MATLAB Compiler SDK to create Java packages. - Configure Your Environment for Generating Java Packages
Configure the Java environment to compile MATLAB code into Java packages using MATLAB Compiler SDK. - How MATLAB Compiler SDK Java Integration Works
Learn how the MATLAB Compiler SDK Java handles data. - Programming Interfaces Generated by MATLAB Compiler SDK
Learn about the function signatures created to handle MATLAB methods.
Java를 사용하여 생성 및 연동하기
- Generate Java Package and Build Java Application
Create a Java package in MATLAB and implement it with sample Java code.
샘플 애플리케이션
- Create Sample Code to Call Exported Function
Generate sample code in C++, .NET, Java, or Python® by including sample files during packaging. - Integrate Simple MATLAB Function into Java Application
Learn how to integrate a MATLAB generated Java package into a Java application. - Display MATLAB Plot in Java Application
Build a Java application that displays a MATLAB plot. - Create Java Phone Book Application Using Structure Array
Encapsulate a MATLAB function that modifies a structure array containing phone numbers. - Create Java Application with Multiple MATLAB Functions
Implement a signal analyzer application that incorporates multiple functions using dependency analysis. - Assign Multiple MATLAB Functions to Java Class
Create a Java package containing multiple functions to implement a matrix math program. - Use MATLAB Class in Java Application
Use object-oriented design to deploy a MATLAB class in a Java package. - Pass Java Objects to MATLAB
Build a Java package that applies optimization routines to objective functions using theMWJavaObjectRef
class. - Block Console Display When Creating Figures in Java
UsewaitForFigures
in a console-based Java application that generates MATLAB figures.
데이터 관리
- Convert Data Between Java and MATLAB
See guidelines on how to convert data between Java and MATLAB. - Rules for Data Conversion Between Java and MATLAB
Refer to the rules for converting Java types to MATLAB types. - Manage MATLAB Resources in JVM
Properly create and dispose of MATLAB data in your code. - Render MATLAB Image Data in Java
See techniques to work effectively with figure and image data in your code. - Specify Parallel Computing Toolbox Profile in Java Application
Specify profile information for Parallel Computing Toolbox™ applications.
배포 관련 고려 사항
- Define Embedding and Extraction Options for Deployable Java Archive
Manage deployable archive embedding and extraction behavior using either the MWComponentOptions class or environment variables. - Ensure Multiplatform Portability for Java
Ensure platform independence in your compiled MATLAB code. - Limitations on Multiple Packages in Single Java Application
Learn the data types that cannot be shared across Java packages. - Map Functions to Java Classes
Map MATLAB functions to Java class methods during compilation.
원격 메서드 호출
- Remote Method Invocation for Client-Server Applications
Learn how RMI allows you to run separate processes on multiple machines. - Run Client and Server Using RMI
Try an example using RMI with a client and server. - Represent Native Java Cell and Struct Arrays
See an example illustrating the use of native Java cell and struct arrays.
Java 패키지 문제 해결
- Common Failure Messages
Common error messages during Java package integration and possible workarounds.