MATLAB: How to use -singleCompThread with MATLAB Builder JA

javabuilder singlecompthread jar mcrMATLAB Compiler SDK

I want to limit the MCR to only one thread. "maxNumCompThreads" function is working but is deprecated, and mcc does not accept "-R singleCompThread" option when building a java library.

Best Answer

Solved by initialising the MCR on the java side this way:
MWApplication.initialize(new MWMCROption() {
@Override
public String[] toStringArray() {
return new String[] { "-singleCompThread" };
}
});