How can a c++ program get the java version number.
ilantalSep 7 2008 — edited Sep 9 2008To my dismay I discovered that much of the world has old java or no java.
Thus I need to write a simple c++ program, or even bat file - anything will do.
What I need it to do is the command:
java -version
If the output is: java version "1.6......"
the java is OK. Otherwise the program knows something is wrong and can do something else.
I thought this would be a piece of cake, but it isn't.
Basically I need to send the command and capture the output, which should be easy.
It isn't as easy as I thought it would be.
Are there any other ways to know what the version is (if it exists)?
Thanks,
Ilan