visingh Posted June 10, 2013 Share Posted June 10, 2013 I am attaching java program below. Which I am compiling through command line. I am setting the classpath through command line. I have copied jasperReport.5.1.0.jar file in classpath. But stil I am getting"Package net.sf.jasperReports.engine does not exist" Error. I have used the jar file from jaspersoft community version. I have also copied few other dependent jar files. Nothing is working.I have jdk1.7 and JRE1.7 and JRE 7.0 in my machine. I do not have JasperReport server in my machine I am having only jaspersoft studio in my machine.Can somebody help me on this.import java.sql.Connection;import java.sql.DriverManager;import java.util.HashMap;import net.sf.jasperreports.engine.JasperCompileManager;import net.sf.jasperreports.engine.JasperExportManager;//import net.sf.jasperreports.engine.JasperFillManager;//import net.sf.jasperreports.engine.JasperPrint;public class AQM_Test { public static void main(String[] args) { HashMap hm = null; System.out.println("Usage: ReportGenerator ...."); try { System.out.println("Start ...."); // Get jasper report String jrxmlFileName = "C:/reports/C1_report.jrxml"; String jasperFileName = "C:/reports/C1_report.jasper"; String pdfFileName = "C:/reports/C1_report.pdf"; } catch (Exception e) { System.out.print("Exceptiion" + e); } }} Link to comment Share on other sites More sharing options...
Massimo Rabbi Posted June 24, 2013 Share Posted June 24, 2013 Hi, it's not clear to me if you tried to create and compile this file from inside Jaspersoft Studio. Moreover which version are you using? Plug-in or stand-alone?You should be able to see JR packages when creating Java files from inside JSS.Your project must have the "JasperReports Library" in Build Path. Plus if you are using the standalone version you should be sure to enable "Java Development" capabilities. This can be done via Window > Preferences > General > Capabilities.Best regards,Massimo. Link to comment Share on other sites More sharing options...
d.wendler Posted July 3, 2013 Share Posted July 3, 2013 I do have the same issues. I wonder why in 13 years they don't put up a simple sample of how to compile a report from command line / java console app.See:http://community.jaspersoft.com/questions/816973/how-compile-reporthttp://stackoverflow.com/questions/17448539/jasper-classpath-for-imports Link to comment Share on other sites More sharing options...
visingh Posted July 5, 2013 Author Share Posted July 5, 2013 I have resolved this problem.I have added JasperReports-5.1.0.jar file name in classpath by below commandSET CLASSPATH=C:ABCJasperReports-5.1.0.jar;C:ABCWHERE C:ABC is the path where my java program file resides. Then I compiled the program by below commandjavac C:ABCJavaProgram.javaHope it will help you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now