How to include Java class in standalone executable?

7 ビュー (過去 30 日間)
John
John 2019 年 3 月 13 日
回答済み: Mohammad Sami 2020 年 8 月 24 日
I am trying to build a standalone executable using MATLAB compiler. The compiler builds the package. However, when I run the .exe, I receive an error stating that a particular Java class cannot be located on the Java class path. The MATLAB script I trying to compile runs as expected when run in MATLAB, but when I run the executable, I receive the afformetioned error. How do I include the .jar files during the executable compilation?
  1 件のコメント
M A
M A 2020 年 8 月 24 日
Try to add your own Java class path when compiling your application by using 'mcc -e Application.m -a JavaClassPath'.
I think that '*.class' and'*.java' files cannot be automatically recognized by matlab during packaging.

サインインしてコメントする。

回答 (1 件)

Mohammad Sami
Mohammad Sami 2020 年 8 月 24 日
Please add the jar file containing your java code in the section files needed to run your application.
Copied from documentation Files required for your application to run — Additional files required by the generated application to run. These files are included in the generated application installer.

カテゴリ

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