日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

java jar中jar_java – jar中的jar

發(fā)布時(shí)間:2024/2/28 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java jar中jar_java – jar中的jar 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

你將需要一個(gè)自定義類加載器為此,看看

One Jar。

One-JAR lets you package a Java application together with its dependency Jars into a single executable Jar file.

它有一個(gè)螞蟻任務(wù),可以簡(jiǎn)化它的建設(shè)。

Most developers reasonably assume that putting a dependency Jar file into their own Jar file, and adding a Class-Path attribute to the META-INF/MANIFEST will do the trick:

jarname.jar

| /META-INF

| | MANIFEST.MF

| | Main-Class: com.mydomain.mypackage.Main

| | Class-Path: commons-logging.jar

| /com/mydomain/mypackage

| | Main.class

| commons-logging.jar

Unfortunately this is does not work. The Java Launcher$AppClassLoader does not know how to load classes from a Jar inside a Jar with this kind of Class-Path. Trying to use jar:file:jarname.jar!/commons-logging.jar also leads down a dead-end. This approach will only work if you install (i.e. scatter) the supporting Jar files into the directory where the jarname.jar file is installed.

總結(jié)

以上是生活随笔為你收集整理的java jar中jar_java – jar中的jar的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。