- FW Admin
- Java JDK (prerequisite)
Since Netbeans requires the Java Development Kit to be installed as a prerequisite, we need to determine if that is correctly installed first on the macOS client. We will create a new custom field (FW 12.7+) to collect this information.
In the "FileWave Admin console> Assistants> Edit Custom Fields...", define the following Client Script:
# returns the JDK version.
# 8 for 1.8.0_nn, 9 for 9-ea etc, and "no_java" for undetected
if [[ -n $(type -p java) ]]
elif [[ (-n "$JAVA_HOME") && (-x "$JAVA_HOME/bin/java") ]]
# remove \r for Cygwin
local lines=$("$java_cmd" -Xms32M -Xmx32M -version 2>&1 | tr '\r' '\n')
if [[ -z $java_cmd ]]
for line in $lines; do
if [[ (-z $result) && ($line = *"version \""*) ]]
local ver=$(echo $line | sed -e 's/.*version "\(.*\)"\(.*\)/\1/; 1q')
# on macOS, sed doesn't support '?'
if [[ $ver = "1."* ]]
result=$(echo $ver | sed -e 's/1\.\([0-9]*\)\(.*\)/\1/; 1q')
result=$(echo $ver | sed -e 's/\([0-9]*\)\(.*\)/\1/; 1q')
In the Custom Field definition, I can choose to assign the field to all devices, or specifically target only a subset of devices in my inventory. I want to know the JDK version on only my macOS population, so I will create a smart group based off of the OS type and assign the custom field to that smart group. In the Custom Fields dialog, this will look like the following:
- To assign the custom field "Java JDK Version" to the smart group, "macOS", select the smart group in the Clients view and choose "Edit Custom Field(s) Association(s)...". Enable the field association for the "Java JDK Version" custom field.
After the devices send their inventory, this custom field will be evaluated locally on the macOS device and report back to the server. Based on this data, you can build a smart group based off of an inventory query for use in deployment of the Netbeans Installer:
The result shows one device has the required prerequisites (Java JDK = 9) already installed. This group will be used to create an association for the NetBeans installer.
- Let's create the Installer and make the Association to the production smart group:
Prior to assigning any new fileset to a group of production machines, it is recommended (as part of IT best practice), to make the association to a few test devices first. Please ensure that you complete this step before moving to production deployment.
- In the Filesets view, choose "New Desktop Fileset"> MSI/PKG
- Define the NetBeans installer .pkg, downloaded from Oracle.
- Right click on the smart group "Deploy NetBeans IDE" and select "Create Association(s)..."
- Choose the fileset that you created in Step 2 and click "Create Association".
- Update Model.
Only devices that meet the prerequisite of having the JDK installed will be targeted for the NetBeans IDE deployment. Sure, you can create a package that deploys both the JDK and the NetBeans IDE, but this way, you are creating a more streamlined workflow, saving download bandwidth by only deploying the necessary packages to your clients.