How do I detect which kind of JRE is installed — 32bit vs. 64bit

前端 未结 9 1140
离开以前
离开以前 2020-11-27 03:47

During installation with an NSIS installer, I need to check which JRE (32bit vs 64bit) is installed on a system. I already know that I can check a system property \"su

9条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 04:37

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

    http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#64bit_detection

    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".

提交回复
热议问题