我正在尝试使用Java7.1.9JAR创建一个iText文件。但我的情况越来越糟了。我有编译jars、设置类路径和构建路径所需的所有步骤。请帮我解决这个问题。
java.lang.NoClassDefFoundError: com/itextpdf/kernel/pdf/PdfDocument在pdfdoc = new PdfDocument(new PdfReader(file));行中。我的Vaadin8/Maven的POM.xml如下所示。在属性标签中:
<itext.version>RELEASE</itext.version> 在依赖项中,我添加了以下条目:
<!-- https://mvnrepository.com/artifact/com.itextpdf/itext7-core -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>7.1.9</version>
<type>pom</type>
</dependency>我已经使用命令行作为mvn deploy构建了所有jars :deploy-file-Dfile=/barcodes-7.1.9.jarDartifactId=example-app -Dversion=1.0 -Dpackaging=jar -Durl=file:./maven-repository/ -DrepositoryId=maven-repository -DupdateReleaseInfo=true
发布于 2020-01-28 00:19:42
当您的代码依赖于某个类文件,并且它在编译时存在,但在运行时找不到时,就会出现这种情况。查找构建时间和运行时类路径之间的差异。
https://stackoverflow.com/questions/59931116
复制相似问题