Dumping "Java -Version" to variable

Jason
Contributor II

I'm looking at creating an Extension Attribute that grabs the output of running "java -version". However, if no java is installed then i get the output "No Java runtime present, requesting install." That part is fine, but then it opens a dialog and tries to download java.201bee3217e54acc87109162593da8d9

Is there any way to get the output from terminal, but NOT have it request to install? (or another way to get the same version information this would report on)?

Thanks

2 REPLIES 2

hkabik
Valued Contributor

I use this one to get Java version or tell me if it's not installed:

https://jamfnation.jamfsoftware.com/viewProductFile.html?fid=699

Jason
Contributor II

I have a similar one as well, but it only lists the version for plug-ins. There could still be Java on the machine even if it's not in the Internet Plug-Ins folder. The results from "java -version" should be a pointer to the version of java that the system uses, but it has that annoying prompt...