Why do I receive a Java PrinterIOException when I try to print from of one of the desktop windows on Linux?

조회 수: 6 (최근 30일)
When I try to print the contents of one of the desktop windows, such as the Command Window or Editor, I receive the following error message:
java.awt.print.PrinterIOException: java.io.IOException: /usr/bin/lpr: not found
at sun.awt.motif.PSPrinterJob$PrinterSpooler.run(PSPrinterJob.java:679)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.motif.PSPrinterJob.endDoc(PSPrinterJob.java:719)
at sun.java2d.RasterPrinterJob.print(RasterPrinterJob.java:355)
at com.mathworks.mwt.print.MWPrinterJob2.print(MWPrinterJob2.java:80)
at com.mathworks.mwt.text.MWTextComponent$PrintProc.run(MWTextComponent.java:855)
at java.lang.Thread.run(Thread.java:484)
However, I can print MATLAB figures without any problems.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
Printing from the MATLAB Desktop uses Java methods to print, which differs from the methods used to print MATLAB figures.
This exception occurs because the JVM used on Linux has been coded to use '/usr/bin/lpr' as the system command, but the 'lpr' command may exist in another location on your system, such as 'usr/local/bin/lpr'. It is currently not possible to change the location where the JVM looks.
As a workaround, you can create a symbolic link, so that '/usr/bin/lpr' points to the actual location of the 'lpr' command on your system.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by