1

I want to detect the Java Runtime Environment bit(32 or 64) programmatically using VC++.Please suggest how can I do this.

Alok
  • 869
  • 9
  • 25

1 Answers1

1

Its fairly simple actualy, you can use system("command") to see its version(dont forget to include stdlib.h) like this:

system("java -d64 -version");

and on your console you will get the reaply, if it says :

This Java instance does not support a 64-bit JVM. Please install the desired version

this means it's not a 64-bit version.

you can read much more about it in here: detect jre bit version

Community
  • 1
  • 1
Ravid Goldenberg
  • 1,799
  • 3
  • 35
  • 57