Find out 32 bit or 64 bit java jdk version in Java
来源:互联网 发布:数据库教学视频百度云 编辑:程序博客网 时间:2024/06/17 01:12
http://www.cloudhadoop.com/2012/01/find-out-32-bit-jvm-version-or-not-in.html
I have encountered one of the issue with java installation which is not combatable with my 32 bit machine.
32 bit is 4 bytes of size, where as 64 bit is 8 bytes of size. That means 64 bit takes more memory than 32 machines
Most of the times, if your code is complied with 32 bit jdk version, then you need to execute this class files in 32 bit machine/64 bit machine only. This will complies and executes fine, but in some cases if there is machine specific , you are in trouble with issues,so careful while installing jdk versions.
32 bit JVM is not compatible with other 64 bit hosts/frameworks as i have encountered issues tomcat 64 bit on java 32 bit
I am listing down the ways to find out the 32 bit vs 64 bit
As per Sun Specification "There is no public API to find out the 32 bit or 64 bit".
There are number of ways to find out the 32bit version or not.
One way is as "sun.arch.data.model" is one of the system property in JVM which has 32 bit or 64 bit or unknown, so we have to write a simple program to read the property value
So i have written sample code to find out bit version
public class BitVersionDemo { public static void main(String args[]) { System.out.println("version =" + System.getProperty("sun.arch.data.model")); }}
and the output is
version =32that means your installed jdk is 32 bit
on Linux :-
so if your system is installed java 64 bit, by running java -d32 command it gives the following message
bash-3.2$ java -d32 -versionRunning a 32-bit JVM is not supported on this platform.
By giving -d64 command, the following informationn is displayed
-bash-3.2$ java -d64 -versionjava version "1.6.0_27"Java(TM) SE Runtime Environment (build 1.6.0_27-b07)Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
On windows, "java -d32 -version" is giving error so you can write above samle to find out the version
Hope this helps for your debugging.
- Find out 32 bit or 64 bit java jdk version in Java
- 32bit or 64bit
- Java 32-bit VS 64-bit
- Powershell 32-bit and 64-bit version
- 区分ubuntu 32bit or 64bit
- Version of IE 32 bit or 64 bit? - How can I tell which version I am using?
- VTK6 + VS2008 in(win7 32bit or 64 bit)(qt4.8已完成配置!)
- Is it a 32bit or 64 bit system?
- check if unmanaged dll is 32-bit or 64-bit?
- OS & Oracle is 32-bit or 64-bit?
- 简单查看oracle client 位数 32bit or 64 bit
- Windows - Review application whether 32-bit or 64bit
- JDK 32bit与64bit的区别
- How to tell if you’re running the 32 bit or 64 bit kernel in Mac OS X Snow Leopard
- How to run 32-bit app in Ubuntu 64-bit?
- Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bi
- debug 64bit dump of a 32bit process in windows 7 64bit
- 32bit和64bit
- 黑马程序员__ADO.NET基础
- android开发的一些好习惯
- SQL Server 附加数据库失败的解决
- android开发时反编译apk文件
- greenplum 高速装载实例
- Find out 32 bit or 64 bit java jdk version in Java
- ecplice 自动增加注释
- Android 四种加载方式详解(standard singleTop singleTask
- 《c++primer》读书笔记二 复制控制
- SND开发时学习心得
- 零零散散学算法之详解二叉查找树
- wikipedia关于hough变换的介绍
- xp或者win7如何打开jar文件
- 黑马程序员__ADO.NET基础(补充)