How can I specify dependencies in the manifest file and then to include it into my .jar file?

后端 未结 2 689
深忆病人
深忆病人 2021-01-14 07:45

I generated .class files by the following command:

javac -cp \\directoryName\\external.jar myPackageDirectory\\First.java myPackageDirectory\\Second.java
         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-14 08:13

    Further to what Joachim Sauer (very correctly) says, there is a way to pack your dependency jars into the same jar as your own code. The programs that accomplish this create a super-main class and manipulate the classpath to find the dependent jars in your resulting jar.

    Several programs can do this; one of them is called OneJar.

提交回复
热议问题