[英]ClassNotFoundException despite the manifest classpath including a .jar which contains the class
[英]Class not found despite of classpath in MANIFEST
我有這個罐子:
/mybundle.jar/
de/mybundle/myclass.class
lib/mysql.jar
META-INF/MANIFEST.MF
使用以下MANIFEST.MF
Manifest-Version: 1.0
Class-Path: lib/mysql.jar
Main-Class: de.mybundle.myclass
這對我來說似乎都是正確的,但是當我跑步時
java -jar mybundle.jar
當類試圖實例化其中一個MySQL-Library類時,我得到一個NoClassDefFoundException。
我做錯了什么?
如果你的mybundle.jar在c:/ foo中,那么你的mysql.jar就在c:/ foo / lib中。 清單中的Class-Path與您編寫它的方式相對於可執行JAR。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.