Matlab Printing Problem

Source: http://www.novell.com/communities/node/2256/linux+matlab+printing+problem

Problem Description:

When you print from the 'File->Print' menu, an error box appear: "There are no properly configured printers on the system"

Another way to view this problem: when typing the command:

javax.print.PrintServiceLookup.lookupDefaultPrintService",  ans=[].

When you print from the menu, Java is used to send the print job whereas the PRINT command interfaces directly with the operating system.

In this case, Java is unable to find the default printer in your system, so printing from the menu fails.

Solution:

  • Verify Java version (matlab command: version -java)
  • If the java version < 1.6.0_01 than download a new version http://www.java.com/en/download/manual.jsp
  • Verify the java version after the installation
  • Run the script (chmod 754 matlab_print_fix.sh ; ./matlab_print_fix.sh ;)
    The script will add to your profile an alias for matlab:
  • bash (.bashrc): alias matlab="export MATLAB_JAVA=/usr/java/jre1.6.0_01;export JAVA_JVM_VERSION=1.6;matlab"
  • tcsh (.cshrc): alias matlab="setenv MATLAB_JAVA /usr/java/jre1.6.0_01;setenv JAVA_JVM_VERSION 1.6;matlab"
  • Check the default printer (matlab command): javax.print.PrintServiceLookup.lookupDefaultPrintService
  • Print from menu

One thought on “Matlab Printing Problem

Leave a Reply