<p>Hello,</p><p>I am new to using Birt and want to run a simple example code I found at</p><p><a data-ipb='nomediaparse' href='
http://wiki.eclipse.org/Simple_Execute_(BIRT)_2.1'>http://wiki.eclipse.org/Simple_Execute_(BIRT)_2.1</a></p><pre class="_prettyXprint">public class birtTest { public static void executeReport() throws EngineException { IReportEngine engine = null; EngineConfig config = null; try { config = new EngineConfig(); config.setBIRTHome("C:birtbirt-runtime-2_2_1birt-runtime-2_2_1ReportEngine"); config.setLogConfig("c:/temp/test", Level.FINEST); Platform.startup(config); final IReportEngineFactory FACTORY = (IReportEngineFactory) Platform .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY); engine = FACTORY.createReportEngine(config); // Open the report design IReportRunnable design = null; design = engine.openReportDesign("Reports/customers.rptdesign"); IRunAndRenderTask task = engine.createRunAndRenderTask(design); // task.setParameterValue("Top Count", (new Integer(5))); // task.validateParameters(); final HTMLRenderOption HTML_OPTIONS = new HTMLRenderOption(); HTML_OPTIONS.setOutputFileName("output/resample/Parmdisp.html"); HTML_OPTIONS.setOutputFormat("html"); // HTML_OPTIONS.setHtmlRtLFlag(false); // HTML_OPTIONS.setEmbeddable(false); // HTML_OPTIONS.setImageDirectory("C:testimages"); // PDFRenderOption PDF_OPTIONS = new PDFRenderOption(); // PDF_OPTIONS.setOutputFileName("c:/temp/test.pdf"); // PDF_OPTIONS.setOutputFormat("pdf"); task.setRenderOption(HTML_OPTIONS); task.run(); task.close(); engine.destroy(); } catch(final Exception EX) { EX.printStackTrace(); } finally { Platform.shutdown(); } } public static void main(String[] args) { try { executeReport(); } catch (EngineException e) { // TODO Auto-generated catch block e.printStackTrace(); } }}</pre><p>I realized, that this code is pretty old but was not able to find a newer version anywhere. I am using Birt 4.3.2</p><p>So if I try to run the code, I get an error:</p><p>org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:81)</p><p> </p><p>I am pretty sure, I forgot to import something but I am quite confused, what I need to import to my project.</p><p>Next thing is, I don't know, where to set the Birt Home (I alredy read that in newer versions it isn't needed, but I don't know what to do instead of just leaving this line</p><p>config.setBIRTHome("C:birtbirt-runtime-2_2_1birt-runtime-2_2_1ReportEngine");</p><p>out)</p><p> </p><p>I also can't change the BIRTHome, because I did not install Birt like this, I use it as an eclipse plugin. So there is no Birt runtime folder.</p><p>I hope you can help me with this problem, I am pretty confused at the moment.</p><p> </p><p>Best regards,</p><p>birt.newbie</p><p> </p>