com.mathwo​rks.util.S​hutdownRun​timeExcept​ion error

In the past few days I've been getting this message when a job is completed and MATLAB tries to shut down:
com.mathworks.util.ShutdownRuntimeException: Java is shutting down
at com.mathworks.services.Prefs.nativeGetPreferencesDirectory(Native Method)
at com.mathworks.services.Prefs.getPropertyDirectory(Prefs.java:198)
at com.mathworks.services.binding.MatlabKeyBindingPreferenceUtils.resolveToPrefDir(MatlabKeyBindingPreferenceUtils.java:112)
at com.mathworks.services.binding.MatlabKeyBindingPreferences.getModifiedDefaultFile(MatlabKeyBindingPreferences.java:213)
at com.mathworks.services.binding.MatlabKeyBindingPreferences.resolveModifiedDefaultFilesFromPrefs(MatlabKeyBindingPreferences.java:116)
at com.mathworks.services.binding.MatlabKeyBindings.initializeFromPrefs(MatlabKeyBindings.java:717)
at com.mathworks.services.binding.MatlabKeyBindings.<clinit>(MatlabKeyBindings.java:590)
at com.mathworks.widgets.debug.DebuggerManager$ActionShell.<init>(DebuggerManager.java:194)
at com.mathworks.widgets.debug.DebuggerManager$ActionShell.<init>(DebuggerManager.java:190)
at com.mathworks.widgets.debug.DebuggerManager$DebuggerShellActions$1.<init>(DebuggerManager.java:97)
at com.mathworks.widgets.debug.DebuggerManager$DebuggerShellActions.<clinit>(DebuggerManager.java:97)
at com.mathworks.widgets.debug.DebuggerManager.getContinueAction(DebuggerManager.java:292)
at com.mathworks.matlabserver.worker.service.breakpoint.impl13b.DebuggerInstaller.<init>(DebuggerInstaller.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.mathworks.matlabserver.a.b.R(Unknown Source)
at com.mathworks.matlabserver.a.b.<init>(Unknown Source)
at com.mathworks.matlabserver.a.b.<init>(Unknown Source)
at com.mathworks.matlabserver.a.f.initialized(Unknown Source)
at com.mathworks.matlabserver.connectorcommon.b.b.run(Unknown Source)
at com.mathworks.matlabserver.connectorcommon.util.g.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have no idea what this means, so I would very much appreciate your help. Thanks!

2 Comments

I was having the same issue with batch programs that use -nodisplay with R2015b under Redhat Linux 6.6. I believe a race condition occurs between matlab and the java subsystem if you call quit or exit. I was able eliminate the error messages by creating a finish.m file somewhere on my javapath with the two lines:
import java.lang.System
java.lang.System.exit(0)
The error can be replicated by repeated running from the Linux command line:
matlab -nodisplay << EOF
exit
EOF
Hey, I am having the same problem while executing a bash script that calls matlab programs which in turn call the "quit" function. What exactly do you mean by "java path"?

Sign in to comment.

Answers (1)

Old question, but in case anyone ever stumbles upon this. I had this error when calling
exit();
What should be called is
exit;

1 Comment

The times that I have used exit(), it has always worked for me. exit is documented as being the same a quit which is a function (it can take optional arguments.)

Sign in to comment.

Categories

Asked:

on 13 Oct 2015

Edited:

on 16 Aug 2022

Community Treasure Hunt

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

Start Hunting!