简体   繁体   English

我如何将程序与JGoodies Extension捆绑在一起

[英]how i bundle my program with JGoodies Extension

i wrote an application with java , and i use JGoodies in my code . 我用Java编写了一个应用程序,并在代码中使用了JGoodies。 when i export jar file , that file doesn't run in another systems . 当我导出jar文件时,该文件不在其他系统中运行。 how can i bundle my program with JGoodies jar files ? 如何将程序与JGoodies jar文件捆绑在一起?

There are essentially two ways to do this, but it all boils down to making sure that your classes and the JGoodies classes are both in the classpath when the user runs the application. 基本上有两种方法可以做到这一点,但是归结为确保用户运行应用程序时,您的类和JGoodies类都在类路径中。

The first way is to simply distribute your jar file along with the JGoodies jar file, and any jar files that either of them depend upon. 第一种方法是简单地将jar文件与JGoodies jar文件以及它们中任何一个依赖的jar文件一起分发。 The user then must include all (both) of those jars in their classpath with, the '-cp' option to the java command line. 然后,用户必须将所有(两个)罐子都包括在其类路径中,并带有Java命令行的'-cp'选项。

The second option is to re-bundle all of the classes into one big jar file (usually referred to as an 'uber-jar'). 第二种选择是将所有类重新捆绑到一个大的jar文件中(通常称为“ uber-jar”)。 If your build uses Maven, or you can convert to Maven, you can use the Maven Assembly Plugin - http://maven.apache.org/plugins/maven-assembly-plugin/ 如果您的构建使用Maven,或者可以转换为Maven,则可以使用Maven组件插件-http: //maven.apache.org/plugins/maven-assembly-plugin/

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

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