签名的 Jar 可以作为可执行文件运行吗? [英] Can a signed Jar be run as an executable?

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

问题描述

我问是因为我有一个可以运行的未签名 jar 和一个不能运行的签名版本.查看清单,我看不到签名的主要类.

I ask because I have an unsigned jar that runs and a signed version that doesn't. Looking at the manifests, I see no main class thing for the signed one.

我是否必须从 Web 开始运行签名的 jar?

Do I have to run a signed jar from web start?

推荐答案

不一定,但如果您没有 Main-class:在清单中,则不能将其作为可执行文件运行.如果您知道主类,则可以使用 java 可执行文件运行它,例如

Not necessarily, but if you don't have a Main-class: in the manifest, you can't run it as an executable. If you know the main class, you can run it using the java executable, eg

$ java -classpath ./myjar.jar MyClass

这篇关于签名的 Jar 可以作为可执行文件运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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