无法在我的项目中正确包含PDFClown

时间:2014-07-23 08:48:48

标签: java pdfclown

我第一次尝试使用PDFClown。 如在自述文件中所写,我尝试通过以下步骤导入PDFClown项目 在我的Java Workspace,Eclipse IDE中 1)File => import ... =>现有Project into Workspace =>然后我选择了下载的PDFClown Zip(版本0.1.2 Beta)

的Java文件夹

在此之后我在我的包浏览器中有5个项目,4个由PDFClown加上我的项目。 现在,我得到38个错误;最后一个是关于我原始项目中HelloWorld的实现。

编辑:对于凌乱的错误报告我很抱歉,如果有人能以更友好的方式帮助展示,我会很高兴

Description Resource    Path    Location    Type
The import org.pdfclown cannot be resolved  PDFGenerator.java   /sitodove/src   line 7  Java Problem
The import org.pdfclown cannot be resolved  PDFGenerator.java   /sitodove/src   line 8  Java Problem
Sample cannot be resolved to a type PDFGenerator.java   /sitodove/src   line 16 Java Problem
The method run() of type PDFGenerator must override or implement a supertype method PDFGenerator.java   /sitodove/src   line 19 Java Problem
File cannot be resolved to a type   PDFGenerator.java   /sitodove/src   line 24 Java Problem
File cannot be resolved to a type   PDFGenerator.java   /sitodove/src   line 24 Java Problem
The import javax.servlet cannot be resolved HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 10 Java Problem
Document cannot be resolved to a type   PDFGenerator.java   /sitodove/src   line 28 Java Problem
The import javax.servlet cannot be resolved HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 11 Java Problem
Document cannot be resolved to a type   PDFGenerator.java   /sitodove/src   line 41 Java Problem
The import javax.servlet cannot be resolved HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 12 Java Problem
Page cannot be resolved to a type   PDFGenerator.java   /sitodove/src   line 45 Java Problem
The import javax.servlet cannot be resolved HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 13 Java Problem
Page cannot be resolved to a type   PDFGenerator.java   /sitodove/src   line 45 Java Problem
The import org.apache cannot be resolved    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 15 Java Problem
PrimitiveComposer cannot be resolved to a type  PDFGenerator.java   /sitodove/src   line 49 Java Problem
The import org.apache cannot be resolved    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 16 Java Problem
PrimitiveComposer cannot be resolved to a type  PDFGenerator.java   /sitodove/src   line 49 Java Problem
The import org.apache cannot be resolved    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 17 Java Problem
StandardType1Font cannot be resolved to a type  PDFGenerator.java   /sitodove/src   line 54 Java Problem
The import org.apache cannot be resolved    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 18 Java Problem
StandardType1Font cannot be resolved to a variable  PDFGenerator.java   /sitodove/src   line 56 Java Problem
HttpServlet cannot be resolved to a type    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 38 Java Problem
HttpServletRequest cannot be resolved to a type HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 42 Java Problem
FileItem cannot be resolved to a type   HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 137    Java Problem
ServletFileUpload cannot be resolved to a type  HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 56 Java Problem
FileItem cannot be resolved to a type   HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 61 Java Problem
The import org.pdfclown cannot be resolved  PDFGenerator.java   /sitodove/src   line 6  Java Problem
DiskFileItemFactory cannot be resolved to a type    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 55 Java Problem
The import org.pdfclown cannot be resolved  PDFGenerator.java   /sitodove/src   line 5  Java Problem
ServletFileUpload cannot be resolved to a type  HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 56 Java Problem
The import org.pdfclown cannot be resolved  PDFGenerator.java   /sitodove/src   line 4  Java Problem
FileItem cannot be resolved to a type   HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 52 Java Problem
FileItemFactory cannot be resolved to a type    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 55 Java Problem
ServletFileUpload cannot be resolved    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 46 Java Problem
FileItem cannot be resolved to a type   HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 50 Java Problem
HttpServletResponse cannot be resolved to a type    HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 43 Java Problem
ServletException cannot be resolved to a type   HelloWorld.java /pdfclown.samples.web/src/org/pdfclown/samples/web  line 44 Java Problem

编辑:其实我已经下载了org.apache.commons.fileupload Jar,然后将它包含在Project =>中属性=> Java Build Path => Libraries =>添加外部罐子 现在我的错误少了......但它真的必须那么复杂吗?

1 个答案:

答案 0 :(得分:2)

如果您只想在项目中包含PDF Clown,则不需要导入其分发项目(包含完整源代码和预编译的jar文件):您需要做的只是选择您可以在发行版(PDFClown / java / pdfclown.lib / build / package)中找到预编译的jar ,并将它们放在项目的依赖项中。

或者,如果您想尝试分发样本(基于CLI,基于GUI和基于Web),那么您必须遵循自述文件,考虑到(作为您的错误报告显示)如果你想使用网页样本(因为你已经知道网络项目是如何工作的,对吧?)你必须设置你的网络服务器(BTW, commons-fileupload-1.2.jar已包含在项目中,无需搜索)。如果您不知道eclipse中的Web服务器设置,那么请查看Web上可用的万亿教程,否则您只需关闭eclipse中的Web示例项目(pdfclown.samples.web),这样就不会再烦扰您了。您可以愉快地运行CLI和GUI示例!