I'd look to see if the plugin has a function to check for Java. The initialization of the plugin may look for Java and return an error if it isn't there. It'll depend on the plugin.
If not, there is tool on the Oracle website to look for Java. Wondering if you can put that in a web viewer and scrape the content. That might be a bother as it's likely a java applet doing the checking and you may not be able to test the results. Run a VB Script to check?
I'd say there probably is a way, just need to find it.
One way is simply do command 'java -version' in Send Event scriptstep.
To get the result, redirect it to a file.
Or using BaseElements plug-in make it easy.
If [ BE_ExecuteSystemCommand ( "java -version" )="?"]
//Java is not installed.
Silent install of Java is
I tried it but UAC dialog apears.
I tried "java -version" and that does indeed return the version but only if executed in Java's bin directory.
i.e. C:\Program Files\Java\jdk1.7.0_51\bin
With the version number embedded in the path and java getting updates all-the-time the bin folder's path is not predictable. I'd need some other mechanism for determining the exact path. I suppose a VBScript could be employed but UAC would prevent it from running I'm guessing.
As far as using a plugin to determine whether Java is present so I can use a different plugin, well that's introducing more moving parts and getting a bit too convoluted for me.
This idea is more of a nice to have than a must have so I'm going to admit defeat and walk away empty handed.
Thanks for the suggestions though fellas.
If you can't dig as deep as whether Java itself is installed, could you try a simple script just to test the function of the plugin? You could run a script on file open that makes use of the plugin and tests the results. If the plugin fails to work, you could provide the user with feedback indicating that Java might need to be installed. You could even have the script send yourself an email with details about the computer involved, so you could then follow up with the user personally. Could there be a stop-gap approach there?
At a broader scope, what do you use to install the plugins on the client machines? If you're using any kind of configuration management system like SCCM or ManageEngine or Casper or what have you, you could simply make sure that Java is installed as well as the plugins. If you use any script to automate plugin deployment, you could include a Java installation as part of that. (If you're just using FileMaker's plugin deployment facilities, well I dunno.)
Your path is JDK, not JRE.
Usually users are not developer, so if Java isn't installed in %path% installing jre may not be problem.
Anyway, overriding UAC shouldn't be done on its concept...