我正在尝试运行报告,我非常确定该文件在那里,但仍然收到此消息我尝试在包内到处更改目录。我正在使用Mac(ios)。
这个错误
java.io.FileNotFoundException: \Users\jeffyarias\NetBeansProjects\LOAN\src\reporte\cliente.jrxml (No such file or directory) BUILD SUCCESSFUL (total time: 10 seconds)
try{
Class.forName("org.gjt.mm.mysql.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1/Loan", "root", null);
String reportpath="\\Users\\jeffyarias\\NetBeansProjects\\LOAN\\src\\reporte\\cliente.jrxml";
JasperReport jr= JasperCompileManager.compileReport(reportpath);
JasperPrint jp= JasperFillManager.fillReport(jr, null, con);
JasperViewer.viewReport(jp);
con.close();
}
catch (Exception ex){
System.out.println(ex.getMessage());
}
答案 0 :(得分:0)
您使用Mac(ios)
尝试编写如下路径:
/Users/jeffyarias/NetBeansProjects/LOAN/src/reporte/cliente.jrxml