Java and printing: No print service found.

Dominik Epple epple at
Sat Apr 3 03:53:02 PST 2004


I have a box with FreeBSD-5.2.1-RELEASE, system and ports rebuilt from
cvsuped sources around Feb 28. There is also installed the native
jdk-1.4.2, patchset 6. As printing system, cups-1.1.20 is installed and
working, i.e. printing via lpr is possible and lpq and stuff.

A self-written, existing Java application is now to be run on this
machine. This application uses the Java print api and printing works,
for example, when running this application under linux. However,
on the FreeBSD box, trying to print gives just a Message Box with
the text "No print service found.".

This Problem can be reproduced with this tiny Java program:

import java.awt.print.PrinterJob;

class DummyPrinter {
  public static void main(String[] args) {
    PrinterJob printJob=PrinterJob.getPrinterJob();

Compiling and running this program just pops up the Message Box with
this "No print service found." text.

This behavior is also present when using linux-sun-jdk1.4.2.

How can I fix this problem? It would already be great to somehow make
the system just go on to display the dialog even without being able to
print to the printer, but to setup printing to print into a file.

Regards, Dominik.

More information about the freebsd-questions mailing list