简体   繁体   中英

Creating a jar file to be run on any other machine

我必须创建一个jar文件,其中我需要在类路径中添加外部jar文件,属性文件,以便在其他任何计算机上运行它。

您可以使用manifest.mf定义外部类路径,也可以使用组成类路径并运行您的应用程序的脚本。

I really recommend you to use a build tool such as Maven for these things:

http://maven.apache.org/

How can I create an executable JAR with dependencies using Maven?

Regards,

Boskop

You can make the jar in almost any IDE. I agree with Michael SchmeiBer, be a bit more specific please.

I use eclipse as my IDE (because you can both use it in windows and Ubuntu Linux) to make a jar (you can define the startup class in the jar).

I use different methods for starting up of different machines.

I use nsis to create a nice windows executable (.exe) You can include your own icon.

In nsis script you actually use the same command you would use in a batch command. nsis has some nice features, like search for a java jre.

For Linux and Mac I use a .sh file with this command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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