Specifying the Default Java Platform

If there are multiple versions of Java installed on the same image, then you can specify the default or preferred Java version using Mediator. A Mediator contains a set of links to different implementations of an application, where every link has the same mediator name and link path, but different target link paths.

View the Current Default Version

Use pkg mediator command to display all mediators in the image and the current default Java version.
$ /usr/bin/pkg mediator | grep java

Set the Default Java Version

Use the pkg set-mediator command to set Java 17 as the default or preferred version.
$ usr/bin/pkg set-mediator -V 17.interim.update.patch java