I am new to OS x programming , I am looking for the best way to check if Java is installed on Current machine.
The only thing that is coming to my mind is to run NSTask and read stdout ... but I am pretty sure that there is better way to do it. Thanks.
well I think you probably have lots of options, but the most reliable would be to write a java program that outputs in JSON or XML or whatever, all of the requirements that you need in your jvm (like version if some module can be loaded etc) then fire it up with NSTask... if you want to check in your own process you could just check for the existence of files... which wouldn't be AS reliable as it wouldn't gauranteed that the clients java actually works.. but it is going to be 90+% reliable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With