title: JasperReports Error | Trying to load file from System32 folder under windows
body: <p>Having a Swing application using <em>DynamicReports</em> (which in turn built over Jasper reports) to print(show and save) pdf file.</p>
  
  <p>The application runs smoothly in <em>Eclipse</em> invocation of the <em>Swing</em> application, but fails giving <code>FileNotFoundException(Access is denied)</code>, when ran as executable jar.</p>
  
  <p>The following stack trace:</p>
  
  <pre><code>    C:\WINDOWS\system32\Report_1370232068590_862159.java
      at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperReport(JasperReportBuilder.java:278) ~[jar:rsrc:dynamicreports-core-3.1.3.jar!/:na]
      at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperPrint(JasperReportBuilder.java:308) ~[jar:rsrc:dynamicreports-core-3.1.3.jar!/:na]
      at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.export(JasperReportBuilder.java:596) ~[jar:rsrc:dynamicreports-core-3.1.3.jar!/:na]
      at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toPdf(JasperReportBuilder.java:516) ~[jar:rsrc:dynamicreports-core-3.1.3.jar!/:na]
      at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toPdf(JasperReportBuilder.java:512) ~[jar:rsrc:dynamicreports-core-3.1.3.jar!/:na]
      at test.firewall.desktop.FirewallAccessTask.makeFirewallPIEChart(FirewallAccessTask.java:130) [rsrc:./:na]
      at test.firewall.desktop.FirewallAccessTask.doInBackground(FirewallAccessTask.java:86) [rsrc:./:na]
      at test.firewall.desktop.FirewallAccessTask.doInBackground(FirewallAccessTask.java:1) [rsrc:./:na]
      at javax.swing.SwingWorker$1.call(Unknown Source) [na:1.7.0_21]
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [na:1.7.0_21]
      at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_21]
      at javax.swing.SwingWorker.run(Unknown Source) [na:1.7.0_21]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_21]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_21]
      at java.lang.Thread.run(Unknown Source) [na:1.7.0_21]
  Caused by: net.sf.jasperreports.engine.JRException: Error saving expressions class file : C:\WINDOWS\system32\Report_1370232068590_862159.java
      at net.sf.jasperreports.engine.util.JRSaver.saveClassSource(JRSaver.java:153) ~[jar:rsrc:jasperreports-5.0.4.jar!/:na]
      at net.sf.jasperreports.engine.design.JRAbstractCompiler.getSourceFile(JRAbstractCompiler.java:310) ~[jar:rsrc:jasperreports-5.0.4.jar!/:na]
      at net.sf.jasperreports.engine.design.JRAbstractCompiler.createCompileUnit(JRAbstractCompiler.java:282) ~[jar:rsrc:jasperreports-5.0.4.jar!/:na]
      at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:177) ~[jar:rsrc:jasperreports-5.0.4.jar!/:na]
      at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:240) ~[jar:rsrc:jasperreports-5.0.4.jar!/:na]
      at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:490) ~[jar:rsrc:jasperreports-5.0.4.jar!/:na]
      at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperReport(JasperReportBuilder.java:275) ~[jar:rsrc:dynamicreports-core-3.1.3.jar!/:na]
      ... 14 common frames omitted
  Caused by: java.io.FileNotFoundException: C:\WINDOWS\system32\Report_1370232068590_862159.java (Access is denied)
      at java.io.FileOutputStream.open(Native Method) ~[na:1.7.0_21]
      at java.io.FileOutputStream.&lt;init&gt;(Unknown Source) ~[na:1.7.0_21]
      at java.io.FileOutputStream.&lt;init&gt;(Unknown Source) ~[na:1.7.0_21]
      at java.io.FileWriter.&lt;init&gt;(Unknown Source) ~[na:1.7.0_21]
      at net.sf.jasperreports.engine.util.JRSaver.saveClassSource(JRSaver.java:145) ~[jar:rsrc:jasperreports-5.0.4.jar!/:na]
      ... 20 common frames omitted
  </code></pre>