安装的jvm是64位或32位

编程入门 行业动态 更新时间:2024-10-27 16:32:45
本文介绍了安装的jvm是64位或32位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何识别已安装的Java版本是 64位还是 32位?

How can I identity whether the installed version of Java is 64 bit or 32 bit ?

推荐答案

您可以获得 os.arch 属性:

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

这将告诉您操作系统的体系结构,因此不完全是VM的体系结构。

This will tell you the architecture of the OS, so not exactly the one of the VM.

Sun的JRE具有以下属性(来自我的机器的值)可能有用:

Sun's JREs have the following properties (values from my machine) that may be useful:

sun.arch.data.model : 32 sun.cpu.isalist : pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

但请记住,这些不适用于其他供应商的虚拟机。所以你可能也希望找到其他虚拟机的这些属性,这样你就不依赖于供应商了。

But have in mind that these will not work on VMs from other vendors. So you may want to find such properties of other VMs as well, so that you are not vendor-dependent.

更多推荐

安装的jvm是64位或32位

本文发布于:2023-10-24 07:34:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1523335.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:jvm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!