-1

On my 64 bit PC I have installed both 32 bit and 64 bit JRE(Java Runtime Environment). I have a java application. According to my requirements I need to find out which of the installed java (32 bit or 64 bit), my application is using ? Finding java version alone (example : 1.7, 1.8 etc.) is not enough. I need to find out which bit version of JRE (32 bit or 64 bit) my application is using ?

The same implementation I want to do in C# application. I mean I want to know from C# application that which bit version(32 or 64) any java application on same PC will use ?

Manak
  • 261
  • 3
  • 13

1 Answers1

2

Use SystemUtils class from org.apache.commons.lang :

String bit = System.getProperty("sun.arch.data.model"); //64
// commons-lang
String javaVersion = SystemUtils.JAVA_VERSION; //1.7.0_71
String jreVersion = SystemUtils.JAVA_RUNTIME_VERSION; //1.7.0_71-b14
2787184
  • 3,749
  • 10
  • 47
  • 81
  • Thanks Ravi, I want to extend my question. I want to know that the same solution can be implemented from C# application or not ? I mean I want to know from C# application that which bit version of Java a java application will use on same PC. – Manak Aug 21 '15 at 08:03