MATLAB: Do PMODE and other commands requiring Java sometimes fail to start when the -nodisplay startup option is used

dctjavaMATLABnodisplaypctpmode

PMODE or other commands requiring Java might fail to start if the -nodisplay option is used on a linux machine. The following error is produced with PMODE:
>> pmode start lsf 3
??? Error using ==> pmode>iVerifyJava at 303
pmode is not supported because Java is not currently available.
Error in ==> pmode at 62
iVerifyJava();

Best Answer

This error is because all Java modules except for the JVM modules are disabled with the -nodisplay option. PMODE requires that the swing Java modules are available.
The modules available are:
jvm - The Java Virtual Machine
The modules which are disabled are:
awt - Abstract Window Toolkit components (GUI components).
desktop - The MATLAB interactive desktop.
swing - Swing components. (lightweight GUI components in the Java Foundation classes)