我得到的错误在Ubuntu 11运行此代码:
JasperReport jasperReport = JasperCompileManager.compileReport("/resources/etiquetas/etiquetaEndereco.jrxml");
JasperPrint print = JasperFillManager.fillReport(jasperReport, parametros);
JasperViewer.viewReport(print);
堆:
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)
我没有发现这个错误的解决方案。