rolandc85 Posted June 13, 2009 Share Posted June 13, 2009 If i had compiled a runnable jar file with JRXML files inside, how do i configure my java codes to load the JRXML file in the JAR, instead of having a separate folder containing it?Thanks a lot in advance.Best Regards,Roland Link to comment Share on other sites More sharing options...
loge Posted June 15, 2009 Share Posted June 15, 2009 I dont load JRXML from jars but JASPER files. It should be easy enough to do like that: JasperReport report = (JasperReport) JRLoader.loadObject(this.getClass().getResource(filename)); Where "this" is a class inside a JAR boostrapping the report and filename is something like "com/foo/bar/bla.jasper" This makes the same classloader loading the resource which also loaded the "this" class inside the JAR. Then you can be sure that the classloader can actually handle JARs.Post Edited by loge at 06/15/2009 09:10 Link to comment Share on other sites More sharing options...
rolandc85 Posted June 15, 2009 Author Share Posted June 15, 2009 woot thanks man...i will try it. i didn't notice that when i save a jrxml, a .jasper is there too 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