I'm getting the error with this code running on Ubuntu 11:
JasperReport jasperReport = JasperCompileManager.compileReport("/resources/etiquetas/etiquetaEndereco.jrxml");
JasperPrint print = JasperFillManager.fillReport(jasperReport, parametros);
JasperViewer.viewReport(print);
Stack:
GRAVE: java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:432)
at java.awt.Frame.<init>(Frame.java:403)
at java.awt.Frame.<init>(Frame.java:368)
at javax.swing.JFrame.<init>(JFrame.java:158)
at net.sf.jasperreports.view.JasperViewer.<init>(JasperViewer.java:264)
I don't find solution for this error.
As Java documentation shows,
java.awt.HeadlessException
is:(Source)
and, for
java.awt.GraphicsEnvironment
:(Source)
Check if your report source file (
etiquetaEndereco.jrxml
) is calling fonts that could not be installed on your system.