如何确保jnlp在64位jvm上运行

发布于 2024-12-21 07:57:50 字数 103 浏览 4 评论 0原文

我有一个 JNLP 小程序,它在安装了 32 位和 64 位 JVM 的 64 位计算机上运行。 JNLP 必须运行在 64 位 JVM 上才能正确执行。有没有办法强制使用 64 位 JVM?

I have a JNLP applet that is run on a 64bit computer with both 32 and 64 bits JVM installed.
The JNLP must run on the 64bit JVM in order to execute correctly. Is there a way to force the use of a 64bit JVM?

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

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

发布评论

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

评论(3

多情癖 2024-12-28 07:57:50

使用 -d64 VM 选项仅允许虚拟机以 64 位启动。否则很简单无法启动。不友好,但做好工作。在控制台模式打印:

Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.

从 1.5.0 开始支持 -d64

Use -d64 the VM option to only allow the virtual machine to start at 64bits. Other way it's simple not start. Not to friendly but make the job. In console mode print:

Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.

-d64 is supported since 1.5.0

瀞厅☆埖开 2024-12-28 07:57:50

请参阅此处:如何判断我是在 64 位 JVM 还是 32 位 JVM 中运行(从程序内)?

您可以使用它来检测 64 位 JVM,以及是否是不,您会显示错误消息。

See here: How can I tell if I'm running in 64-bit JVM or 32-bit JVM (from within a program)?

You can use this to detect a 64-bit JVM, and if it's not, you show an error message.

丶视觉 2024-12-28 07:57:50

如果您使用 64 位浏览器,则使用 64 位 JVM。如果您使用 32 位浏览器(当今大多数浏览器的默认版本),则使用 32 位 JVM。例如,firefox和chrome只有32位版本(当然还有测试/开发版本但没有任何官方消息)。 Microsoft IE 是少数几个提供两个版本的浏览器之一。

您无法确保 jnlp 能够在 64 位环境中运行。但是您可以确保您的小程序代码是在正确的环境中启动的:

String architecture = System.getProperty("os.arch");

if(architecture.equals("i386") || architecture.equals("i686")){
 architecture = "x86";
}
else if(architecture.equals("amd64") || architecture.equals("universal")){
 architecture = "x86_64";
}

If you use a 64Bit Browser then the 64Bit JVM is used. If you use a 32Bit Browser (which is default for most browsers nowadays) the 32Bit JVM is used. So e.g. firefox and chrome only have 32Bit versions out there (of course there are test/develop versions out there but nothing official). Microsofts IE is one of the few offering both versions.

You can not ensure that the jnlp will run in 64 Bit environment. However you can ensure in your applet code, that is was started in the right environment:

String architecture = System.getProperty("os.arch");

if(architecture.equals("i386") || architecture.equals("i686")){
 architecture = "x86";
}
else if(architecture.equals("amd64") || architecture.equals("universal")){
 architecture = "x86_64";
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文