java.lang.NoClassDefFoundError: Could not initialize class sun.print.CUPSPrinter
Вопрос
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
Решение
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.
Не связан с StackOverflow