MATLAB: Does MATLAB 7.0 (R14) crash when I try to print from the Editor/Debugger on some Linux systems that use CUPS

cupseditorjavajava.lang.illegalargumentexceptionlinuxMATLABprintservices

When printing from the Editor/Debugger, MATLAB 7.0 (R14) crashes and returns the following Java error:
java.lang.IllegalArgumentException: services must be non-null and non-empty
at javax.print.ServiceUI.printDialog(Unknown Source)
at com.mathworks.widgets.SyntaxTextPane.printDocument(SyntaxTextPane.java:2725)
at com.mathworks.mde.editor.EditorView.doPrint(EditorView.java:1194)
at com.mathworks.mde.editor.EditorView.access$1300(EditorView.java:44)
at com.mathworks.mde.editor.EditorView$5.update(EditorView.java:407)
at java.util.Observable.notifyObservers(Unknown Source)
at com.mathworks.mde.editor.GenericAction$RegisteredObservable.notifyRegisteredObservers(GenericAction.java:327)
at com.mathworks.mde.editor.GenericAction.actionPerformed(GenericAction.java:318)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
<snip>

Best Answer

This problem may occur as a result of incompatibilities between Java and certain CUPS configurations, namely when CUPS' "Browsing" feature is enabled.
Some customers have reported that they can work around this issue, by doing the following:
1) Edit your
/etc/cups/cupsd.conf
file and replace any instances of
Browsing On
with
Browsing Off
If there are no
Browsing On
instances, add a
Browsing Off
line at the end of the file.
2) Access your printer list via
http://localhost:631
and delete all printers except those that are manually defined.