简体   繁体   English

JAR无法识别引用的库

[英]JAR does not recognize referenced libraries

When I launch jar file from terminal it gives java.lang.NoClassDefFoundError as obviously it cannot recognize referenced libraries that I have included in the project. 当我从终端启动jar文件时,它给出了java.lang.NoClassDefFoundError,因为它显然无法识别我已经包含在项目中的引用库。

Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: org/icepdf/core/exceptions/PDFException

However I have added them to build path. 但是我添加了它们以构建路径。

I am using the following command to launch my application: 我正在使用以下命令启动我的应用程序:

java -jar app.jar

What can be wrong? 有什么事吗

If you have your core project in the workspace: 如果您的核心项目在工作区中:

  • Right click on the project that will use the core project in Eclipse 右键单击将在Eclipse使用核心项目的项目
  • Go to properties 前往properties
  • Then " Deployment Assembly " on the left 然后左侧的“ Deployment Assembly
  • Use the button Add on the right 使用右侧的Add按钮
  • Choose project and search your core project and use the " Finish " button 选择project并搜索您的核心项目,然后使用“ Finish ”按钮
  • Built your project 建立您的专案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM