如何制作可运行的jar文件? [英] How to make a runnable jar file?

查看:24
本文介绍了如何制作可运行的jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了一个程序来制作可运行的 .jar 文件.. 我现在找到的所有文件都是制作 .exe 文件的.. 我记得它也有将文件制作成 .sh 脚本的选项以及.有人知道它的名字吗?我已经搜索了几个小时但无济于事:/

There was a program that I used that made runnable .jar files.. All the ones I'm finding now are ones that make .exe files.. I remember it also has the option to make the file a .sh script as well. Anyone knows its name? I've been searching for hours with no avail :/

推荐答案

命令行

java -jar file.jar

将运行您的 jar 文件,如果它有一个 Main-Class 定义为 这里.

Will run your jar file if it has a Main-Class defined as explained here.

您可以在 shell 脚本中使用该命令.

You can use that command in a shell script.

这篇关于如何制作可运行的jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆