How to know if a JVM running in Java is 32-bit or 64-bit

Asked 1 years ago, Updated 1 years ago, 79 views

Is there a way to write a function or something on a program in Java to know if the JVM is running at 32 bits or 64 bits?

java jvm jni 32-bit 64-bit

2022-09-21 22:09

1 Answers

Sun has a Java System property that determines how many bits the JVM is, which is usually 32 or 64.

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

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


2022-09-21 22:09

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.