Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Birt类EngineeException的NoClassDefFoundError_Java_Eclipse_Installation_Birt - Fatal编程技术网

Java Birt类EngineeException的NoClassDefFoundError

Java Birt类EngineeException的NoClassDefFoundError,java,eclipse,installation,birt,Java,Eclipse,Installation,Birt,是否有人成功地将Birt库添加到项目的构建路径中 我使用帮助-->安装新软件并从官方网站复制粘贴Birt 4.2.2的链接,在Eclipse中安装了Birt。Birt是从互联网上下载的,出现了一个新的视角,即报告设计。除了它,没有图书馆,什么都没有。因此,我设计了我的报告,并开始编写Java代码,以便将我的报告导出为PDF格式,正如我在互联网上发现的那样。我写了以下内容: // Export Birt report String format = HTMLRenderOption

是否有人成功地将Birt库添加到项目的构建路径中

我使用帮助-->安装新软件并从官方网站复制粘贴Birt 4.2.2的链接,在Eclipse中安装了Birt。Birt是从互联网上下载的,出现了一个新的视角,即报告设计。除了它,没有图书馆,什么都没有。因此,我设计了我的报告,并开始编写Java代码,以便将我的报告导出为PDF格式,正如我在互联网上发现的那样。我写了以下内容:

// Export Birt report
        String format = HTMLRenderOption.OUTPUT_FORMAT_PDF;
        EngineConfig config = new EngineConfig( );
        config.setEngineHome( "C:\\Tools\\Eclipse\\plugins\\org.eclipse.birt.report.viewer_4.2.2.v201302041142\\birt" );
        HTMLEmitterConfig hc = new HTMLEmitterConfig( );
        HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
        hc.setImageHandler( imageHandler );
        config.setEmitterConfiguration( HTMLRenderOption.OUTPUT_FORMAT_HTML, hc );
        ReportEngine engine = new ReportEngine( config );
        IReportRunnable report = null;
        String reportFilepath = "C:/Workspace/reports/new_report.rptdesign";
        try {
            report = engine.openReportDesign( reportFilepath );
        }
        catch ( EngineException e ) {
            System.err.println( "Report " + reportFilepath + " not found!\n" );
            engine.destroy( );
            return;
        }
        IRunAndRenderTask task = engine.createRunAndRenderTask( report );
        HTMLRenderOption options = new HTMLRenderOption( );
        options.setOutputFormat( format );
        options.setOutputFileName( "C:/Workspace/reports/output.pdf" );
        task.setRenderOption( options );
        task.setParameterValues( parametersMap );
        try {
            task.run( );
        }
        catch ( EngineException e1 ) {
            System.err.println( "Report " + reportFilepath + " run failed.\n" );
            System.err.println( e1.toString( ) );
        }
        engine.destroy( );
        return;
当然,在我的构建路径中没有设置Birt库,所以所有Birt对象都是红色的。我手动添加了Eclipse插件文件夹中存在的所有Birt JAR,所有的红色都消失了。看起来一切都很顺利。当我运行它时,我得到:

java.lang.NoClassDefFoundError: org/eclipse/birt/report/engine/api/EngineException
而org.eclipse.birt.report.engine.api包存在于我的构建路径中 并且包中存在EngineeException.class。我觉得有一些jar文件我丢失了。 我在Birt主页上搜索了一个解决方案,但什么也没找到。大多数教程都有关于如何生成报告的说明。但是没有关于如何使用Java启动和运行库的内容


是否有一种标准的、自动的或官方的方法将Birt库添加到Eclipse?它是由Eclipse制作的。这不应该这么难。如有任何帮助,我们将不胜感激。

您是否已阅读本页->
也许你可以在那里找到一些提示。

这很管用,伙计!!我只需将lib文件夹从Birt运行时复制到WEB-INF/lib文件夹,它最终就可以工作了。这是在你发布的链接上设置的前两个步骤。非常感谢。为什么他们不在他们的网站上说些什么呢??