sdkman has a specific output format for Java candidate since
there are multiple vendors and builds. For example, when running
`sdk list maven`, the format is a simple list like:
3.6.2
3.6.1
3.6.0
3.5.4
3.5.3
3.5.2
3.5.0
3.3.9
But for `sbt list java`, the output is a table like:
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
AdoptOpenJDK | | 15.0.1.j9 | adpt | | 15.0.1.j9-adpt
| | 15.0.1.hs | adpt | installed | 15.0.1.hs-adpt
...
Amazon | | 15.0.1 | amzn | | 15.0.1-amzn
| | 11.0.9 | amzn | | 11.0.9-amzn
...
Azul Zulu | | 15.0.1 | zulu | | 15.0.1-zulu
| | 15.0.1.fx | zulu | | 15.0.1.fx-zulu
...
Therefore, the completion script has to handle both formats.
The versions that can be installed were not completed. The list of available versions showed the installed versions.
The function retrieves the available versions and removes the already installed versions.