安装的jvm是64位还是32位 [英] Installed jvm is 64 bit or 32 bit

查看:39
本文介绍了安装的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");

这将告诉您操作系统的架构,因此不完全是虚拟机的架构.

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

但请记住,这些不适用于其他供应商的 VM.因此,您可能还想找到其他 VM 的此类属性,这样您就不会依赖于供应商.

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位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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