How to check with a program in another programming language (C, C ++, etc.) if Java is installed and where

I would like to know if Java is installed and where (path). It may sound strange, but I want BOINC (coded in C ++) to check the Java installation and then launch the Java application. But so I need to know if BOINC can launch Java natively, or if I should also send the JRE and then launch the application with that JRE not installed.

So, is there a way to test the installation first?

Thank you in advance!

Andreas

+2


a source to share


1 answer


I would start by checking the java environment variables,

also on linux / unix distributions you can try "what java" command and on windows operating systems you can check the registry.



If all else fails, you can also try to find the java binary, but I think this is not practical (takes a long time).

+5


a source







All Articles