The chef client already has java installed on it. How can I check which version of java is installed using chef. I know I can write a small ohai plugin to do the same but is there any other way to check which java version is installed on the client? The java installation is not an rpm installation though on some endpoints it might be an rpm installation.
解决方案
However this is complicated because you can have multiple Java installs in parallel as long as you set $JAVA_HOME and whatnot for each application, and there is no overall standard for JVM file locations, so if you think you might have multiple versions or just one version but off $PATH you'll need to use code similar to the Ohai plugin in your own recipe (or your own Ohai plugin if you wanted to get fancy).