How do I check what version of java im using in c++

254 views Asked by At

I have a testing script that checks what version of java the user is using and then executes some commands. But we are trying to convert all of our testing into cxxtests. I would like to know how to convert my version checking script into c++ code. I know I could just use the system() command but I would like that to be a last resort. Any help or leads would be appreciated.

Thanks, Josh

1

There are 1 answers

0
Erick Robertson On BEST ANSWER

You have to use the system() command, or a C++ library that will use the system() command. This task is much better done in a shell script than C++ code. If necessary, the shell script can call C++ code to do notifications, or whatever it is that's causing the reliance on C++.