java 如何从 .jnlp 文件中获取 .jar 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11594047/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 05:42:23  来源:igfitidea点击:

how to get .jar file from .jnlp file?

javajarjnlp

提问by Qiang Xu

To play the go game, I went to http://www.gokgs.com/download.jspto start the client with Java Web Start. Essentially, it is a .jnlp file that can automatically update the client.

为了玩围棋游戏,我去http://www.gokgs.com/download.jsp用 Java Web Start 启动客户端。本质上,它是一个可以自动更新客户端的 .jnlp 文件。

It is cool. Still, I am wondering how I can fetch the underlying .jar file from this .jnlp file. I checked my local java 6.0 cache directory, and didn't find any .jar file over there.

很酷。不过,我想知道如何从这个 .jnlp 文件中获取底层的 .jar 文件。我检查了本地 java 6.0 缓存目录,并没有在那里找到任何 .jar 文件。

Anybody knows how to get a stand-alone version of this cgoban client?

有人知道如何获得这个 cgoban 客户端的独立版本吗?

回答by Dennis

JNLP is just an XML file. You can just open the .jnlp file and it will tell you where the .jar file is located. http://files.gokgs.com/javaBin/cgoban.jar

JNLP 只是一个 XML 文件。您只需打开 .jnlp 文件,它就会告诉您 .jar 文件所在的位置。 http://files.gokgs.com/javaBin/cgoban.jar

<jnlp codebase="http://files.gokgs.com" href="javaBin/cgoban.jnlp">
    ...
    <jar href="javaBin/cgoban.jar" main="true"/>

The relevant attributes are the jnlp[codebase]and the jar[href].

相关属性是jnlp[codebase]jar[href]

回答by gregory561

If you open jnlp file in text editor there is a link to jar file. In your case it is: http://files.gokgs.com/javaBin/cgoban.jar

如果您在文本编辑器中打开 jnlp 文件,则会有一个指向 jar 文件的链接。在你的情况下是:http: //files.gokgs.com/javaBin/cgoban.jar