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

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

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