1

I get the following error when sending a job to a printer in Linux.

java.lang.NoClassDefFoundError: Could not initialize class sun.print.CUPSPrinter

Don't know why the class cannot be found, as it's included in rt.jar and i've looked into my rt.jar and the class is there. For more information, my java -version shows

java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

Thank you in advance

Pål Brattberg
  • 4,568
  • 29
  • 40
manolowar
  • 6,772
  • 5
  • 23
  • 18
  • 2
    How you seen that bug report? https://bugs.eclipse.org/bugs/show_bug.cgi?id=297910 Seems to be the same issue, workaround is to set different (local) DISPLAY value. – Code Painters May 12 '11 at 11:44
  • I think, you are trying to run a Java application on a Linux server with no X Server running. Try running with `java -Djava.awt.headless=true ...`. – dma_k Oct 10 '11 at 21:40

1 Answers1

1

As noted in java.lang.NoClassDefFoundError: Could not initialize class XXX, the class is present, but is not initializing correctly.

In a comment, CodePainters points to this report https://bugs.eclipse.org/bugs/show_bug.cgi?id=297910 which implies that $DISPLAY was not set or set correctly.

Community
  • 1
  • 1
codeDr
  • 1,535
  • 17
  • 20