Is there a way to tell the compiler to exclude the JVM if using compiler.b​uild.Stand​aloneAppli​cationOpti​ons?

5 ビュー (過去 30 日間)
Dave
Dave 2024 年 9 月 19 日
編集済み: Dave 2024 年 9 月 27 日
I have an existing build script for a console application that compiles with the following command:
compiler.build.standaloneApplication(opts)
where opts is of the type:
compiler.build.StandaloneApplicationOptions
Is there a way to tell the runtime to exclude the JVM inside the opts argument so that it will load faster? I basically want to do the same thing as:
mcc -m -R -nojvm
Unfortunately, I don't want to re-write this build script because it is a standard script we use.
Thanks in advance,
Dave

回答 (1 件)

Ayush
Ayush 2024 年 9 月 25 日
編集済み: Ayush 2024 年 9 月 25 日
I understand that you can’t change the build script, so, a possible workaround which you can try is starting MATLAB without Java Virtual Machine (JVM).
To start MATLAB without JVM, you can use the following command:
$ matlab -nojvm
You can refer to the following MATLAB answer for more information on how to start MATLAB without JVM: https://www.mathworks.com/support/search.html/answers/32928-matlab-nojvm.html
Hope this helps!
  3 件のコメント
Ayush
Ayush 2024 年 9 月 27 日
You're correct in your understanding. The command in the answer is used to start the MATLAB environment without loading the Java Virtual Machine (JVM). This can be useful for running MATLAB scripts or functions that do not require any Java-based functionality, but it is not directly related to compiling your MATLAB source code into a standalone executable.
To compile your MATLAB code into a standalone Windows executable that does not load the JVM, you can use MATLAB Compiler.
Dave
Dave 2024 年 9 月 27 日
編集済み: Dave 2024 年 9 月 27 日
Thank you, Ayush.
I thought I was using the Matlab compiler when I called compiler.build.standaloneApplication(opts) or did you specifically mean calling 'mcc'?
Like I said, I would prefer to keep the existing structure of our build scripts that call compiler.build.standaloneApplication(opts).
We are distributing this to customers who are unlikely to have the Matlab IDE, only the runtime.
Dave

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

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by