1

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

Alok
  • 929
  • 10
  • 26

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
  • 2,119
  • 4
  • 39
  • 59