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

Asked 2 years ago, Updated 2 years ago, 101 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.