package br.com.empresa.teste; Esta dando este erro quando executo o programa abaixo
import java.sql.Connection; import java.sql.SQLException;
import br.com.empresa.relatorio.ConnectionFactory; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperCompileManager;
public class TestaRelatorio {
public static void main(String[] args) throws SQLException, JRException {
Connection connection = new ConnectionFactory().getConnection();
JasperCompileManager.compileReportToFile("Gasto_por_mes.jrxml");
connection.close();
}
}
======================================
O erro foi este :
Exception in thread "main" net.sf.jasperreports.engine.JRException: Error compiling report java source files : C:\Users\Robson\workspace\Gastos\Gasto_por_mes_1440172395980_271530.java C:\Users\Robson\workspace\Gastos\Gasto_por_mes_charDataSet_1440172395980_271530.java C:\Users\Robson\workspace\Gastos\Gasto_por_mes_CROSSTAB0_1440172395980_271530.java at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:106) at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:77) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:201) at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:354) at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:270) at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:229) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:539) at br.com.empresa.teste.TestaRelatorio.main(TestaRelatorio.java:16) Caused by: java.io.IOException: Cannot run program "javac": CreateProcess error=2, O sistema não pode encontrar o arquivo especificado at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:75) ... 7 more Caused by: java.io.IOException: CreateProcess error=2, O sistema não pode encontrar o arquivo especificado at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 11 more