Some time ago, I wrote an article about distributing Java command-line applications and how difficult it is to locate the proper java binary to run your application with. But let’s have a quick refresher on the problem before going further.
When distributing a Java application via package managers, your application should rely on one of the Java Runtime Environments (a.k.a. JRE) provided by the package manager. Ensuring the correct JRE will be installed as a dependency of your application is the job of the package manager.