jnlp webstart nativelib:如何为操作系统指定不同的体系结构

发布于 2024-08-10 09:15:46 字数 495 浏览 5 评论 0原文

在 java webstart 文件 (jnlp) 中,您可以指定 nativelib 标记来加载二进制文件。您还可以通过指定 os 属性来指定为不同的操作系统加载不同的文件。

例如:

<resources os="Linux">
    <nativelib href="....jar"/>
</resources>

<resources os="Windows">
    <nativelib href="....jar"/>
</resources>

<resources os="Mac OS X">
    <nativelib href="....jar"/> 
</resources>

但是我如何为不同的架构指定不同的二进制文件?例如 win32 和 win64 或 linux 32 和 linux 64 位。操作系统。在哪里可以找到 os 属性的选项列表?

in a java webstart file (jnlp) you can specify the nativelib tag to load binaries. you can also specify toload different ones for different operating systems by also specifying the os attribute.

for example:

<resources os="Linux">
    <nativelib href="....jar"/>
</resources>

<resources os="Windows">
    <nativelib href="....jar"/>
</resources>

<resources os="Mac OS X">
    <nativelib href="....jar"/> 
</resources>

but how can i specify even different binaries for different architectures? for example win32 and win64 or linux 32 and linux 64bit. operating systems. where can i find a list of options for the os-attribute?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南城追梦 2024-08-17 09:15:46

要确定您基本上需要 os.arch 属性。另请参阅 http://lopica.sourceforge.net/os.html 了解完整列表。为此,您可以使用 元素的 arch 属性。

To determine that you basically need the os.arch property. Also see http://lopica.sourceforge.net/os.html for a complete list. You can use the arch attribute of the <resources> element for this.

中二柚 2024-08-17 09:15:46

根据 http://jcp.org/aboutJava/communityprocess/mrel/jsr056/ index3.html:

"os 属性:指定应考虑 resources 元素的操作系统。如果该值是 os.name 系统属性的前缀,则 resources 元素如果未指定该属性,则它匹配所有操作系统。”

因此,您需要对要部署到的平台上的 os.name 系统属性的值进行一些调查。

According to http://jcp.org/aboutJava/communityprocess/mrel/jsr056/index3.html:

"os attribute: Specifies the operating system for which the resources element should be considered. If the value is a prefix of the os.name system property, then the resources element can be used. If the attribute is not specified, it matches all operating systems."

So you need to do some investigation of the value of the os.name system property on the platforms you want to deploy to.

相思故 2024-08-17 09:15:46

以下是 Windows 的示例:

<resources os="Windows" arch="x86">
    <nativelib href="....jar"/>
</resources>
<resources os="Windows" arch="x86_64">
    <nativelib href="....jar"/>
</resources>
<resources os="Windows" arch="amd64">
    <nativelib href="....jar"/>
</resources>

https://stackoverflow.com/a/1703973/361855 提供了包含体系结构的链接其他平台的值。

Here's an example for Windows:

<resources os="Windows" arch="x86">
    <nativelib href="....jar"/>
</resources>
<resources os="Windows" arch="x86_64">
    <nativelib href="....jar"/>
</resources>
<resources os="Windows" arch="amd64">
    <nativelib href="....jar"/>
</resources>

https://stackoverflow.com/a/1703973/361855 gives a link with that includes architecture values for other platforms.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文