views:

62

answers:

1

Hi,

I would like to know whether or not Java is installed and where (path). Perhaps it sounds strange, but my aim is to let BOINC (coded in C++) check the Java installation and then start my Java app. But therefore I need to know if BOINC can start Java natively, or if I have to also send the JRE and then start my app with this not installed JRE.

So is there a way to check the installation first?

thank you in advance!

Andreas

+4  A: 

I would start with checking of java's environment variables,

also, in linux/unix distros you can try the "which java" command, and in 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 isn't practical (time consuming).

Shuky Kappon
Hi, i found a program named jsmooth that wrapps jars in exes and this wrapper checks the availibility of java installation or takes a predefined jre folder. What do you think of this solution?
Andreas Hornig
Never heard of it, but it sounds this would do the trick.I would test it with various JRE/JDK installations on different windows operating system to monitor its performance.
Shuky Kappon
JSmooth is what [BOINC's semi-documentation on Java apps](http://boinc.berkeley.edu/trac/wiki/JavaApps) mentions; but I don't know if anyone actually *tried* it.
Nicolás