Using the MATLAB library compiler for Java: compilation error

1 回表示 (過去 30 日間)
Kriti Khare
Kriti Khare 2016 年 2 月 20 日
回答済み: Arnab Sen 2016 年 2 月 24 日
Hello,
I have some MATLAB code that I want to package into a jar file so I may use it in a non-MATLAB machine. I tried making a jar file for a very simple file:
function [ num ] = squareRoot(n)
%%testing testing
num = sqrt(n);
end
Using Library compiler (Java package option), I named the library sr, main class also sr with the method [num] = squareRoot(n). The runtime included in package option was selected.
For this simple case, I get an error while compilation. Attached is the packing log.
Any help would be great! Is there something I am doing wrong? Any suggestions/comments would be helpful!
MATLAB version I am using is R2015a. Java version is 1.7.

回答 (1 件)

Arnab Sen
Arnab Sen 2016 年 2 月 24 日
Hi Kriti,
From the log it seems that the issue might be related to java configuration in your machine.
Refer to the following links and make sure all the configuration is proper before launching MATLAB:
Also check the compatible compilers from following link:
If the issue still persists, use "mcc" command with the -K flag. This will allow MATLAB to keep the intermediate files without deleting them while compiling. Also this creates a working Java package even if the build fails with "javadoc" error.
It is possible that you may be using deploytool for building the JAR file. If you are using deploytool, please use the "-K" flag under Settings-> Additional parameters to MCC.
Please refer to the link below for mcc options:

カテゴリ

Help Center および File ExchangeJava Package Integration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by