博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
判断jdk 是64位还是32位
阅读量:6916 次
发布时间:2019-06-27

本文共 874 字,大约阅读时间需要 2 分钟。

hot3.png

Sun has a Java System property to determine the bitness of the JVM: 32 or 64:

sun.arch.data.model=32 // 32 bit JVMsun.arch.data.model=64 // 64 bit JVM

You can use

System.getProperty("sun.arch.data.model")

to determine if its 32/64 from the program.

From the :

When writing Java code, how do I distinguish between 32 and 64-bit operation?

There's no public API that allows you to distinguish between 32 and 64-bit operation. Think of 64-bit as just another platform in the write once, run anywhere tradition. However, if you'd like to write code which is platform specific (shame on you), the system property sun.arch.data.model has the value "32", "64", or "unknown".

The only good reason is if your java code is dependent upon native libraries and your code needs to determine which version (32 or 64bit) to load on startup.

转载于:https://my.oschina.net/u/2308739/blog/608485

你可能感兴趣的文章
DNS服务的搭建 windows server 2008
查看>>
mysql报错err1055
查看>>
OpenStack 学习笔记(六):OpenStack neutron服务搭建
查看>>
shell中的算数比较
查看>>
quota(linux下的磁盤配額)
查看>>
【MySQL数据库开发之四】MySQL 处理模式/常用查询/模式匹配等
查看>>
Linux NFS服务器配置
查看>>
C++实现计数排序
查看>>
PPT组件Aspose.Slides V17.8发布 | 支持PP2010 PPTX与嵌入式视频
查看>>
Postfix全功能 (1)
查看>>
DOS系统功能调用表(INT 21H)
查看>>
作为JavaScript开发人员,这些必备的VS Code插件你都用过吗
查看>>
未来云世界畅想
查看>>
进程与计划任务
查看>>
组合模式
查看>>
linux文件操作之ls、mkdir、rmdir、cp命令使用
查看>>
观察最大堆的插入/删除元素后最大堆的变化
查看>>
oracle导入时IMP-00010: 不是有效的导出文件, 头部验证失败
查看>>
R:corrplot包
查看>>
用SPK技术分析,泰坦尼克号沉船之后哪些人活下来了
查看>>