For a different approach, have a look at the HW/SW Inventory and check if this already contains the required information (jre/jdk packages installed) and if you can integrate it into your view as you envisioned.
1 Like