Hello On 24/09/2021 16:52, Luigi Baldoni wrote:
BuildRequires: java-devel >= 16
for building
I tried that. Now javac defaults to 11
Yes, for the while the default javac is openjdk 11 and it has the highest alternatives priority. Please, try to add there BuildConflicts: java < 16 java-devel < 16 java-headless < 16 That should avoid having anything lower then 16 on the system during the building.
Now, if your package is java >= 16 only, please have a look whether it is not possible to make some little changes and make it 1.8+
Probably not worth the trouble in this case.
I would contend that it is always worth the trouble, since you would avoid the launcher to have to iterate over existing javas. But it is not my call.
And more importantly, how do I detect and invoke the correct jvm in the launch script at runtime? You will have to iterate over all compatible javas, they are normally in %_libdir/jvm/java-X-openjdk where X is 11, 13, ....
Looks ugly:/ Is it really the only option?
Beauty is in the eyes of the beer-holder. And yes, it is the only option. Cheers F.