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

前端 未结 9 1161
离开以前
离开以前 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:30

    On linux, my (java) vm reports java.vm.name=Java HotSpot(TM) 64-Bit Server VM. The javadocs for System declare that System.getProperty will always have a value for this but are silent on sun.arch.data.model.

    Unfortunately they don't specify what the system property will be so some other JVM might just report java.vm.name=Edgar.

    BTW, by "installed on the system", I assume you mean "the current running JVM"?

提交回复
热议问题