i want to execute a jar in the console, if the jar doesn't depend external jars, the following command will done.
C:/>java -jar test.jar
but if it depends external jars, we should add a line in MANIFEST.MF of jar. like:
Manifest-Version: 1.0
Class-Path: lib/jconn2.jar lib/jTDS2.jar
Sealed: true
Main-Class: com.stefli.test.Test
that means you should collect the jars into a lib folder.
C:/>java -jar test.jar
but if it depends external jars, we should add a line in MANIFEST.MF of jar. like:
Manifest-Version: 1.0
Class-Path: lib/jconn2.jar lib/jTDS2.jar
Sealed: true
Main-Class: com.stefli.test.Test
that means you should collect the jars into a lib folder.
本文介绍如何在控制台中执行一个依赖于外部JAR文件的JAR包。通过修改JAR包中的MANIFEST.MF文件,添加Class-Path属性来指定外部依赖的路径。
169

被折叠的 条评论
为什么被折叠?



