Hi, I'm new to packaging java applications and I've stumbled upon a small problem: first, how do I request openjdk >= 16 without naming it explicitly? And more importantly, how do I detect and invoke the correct jvm in the launch script at runtime? Perhaps there's an obvious answer, but I couldn't find it. Thanks in advance. Hi, I'm new to packaging java applications and I've stumbled upon a small problem. First, how do I request openjdk >= 16 without naming it explicitly? And more importantly, how do I invoke the correct jvm in the launch script at runtime? Perhaps there's an obvious answer, but I couldn't find it. Thanks in advance.
Hello On 24/09/2021 15:18, Luigi Baldoni wrote:
Hi, I'm new to packaging java applications and I've stumbled upon a small problem: first, how do I request openjdk >= 16 without naming it explicitly?
BuildRequires: java-devel >= 16 for building Requires: java >= 16 for runtime 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+
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, .... Cheers Fridrich
Fridrich Strba wrote:
Hello
On 24/09/2021 15:18, Luigi Baldoni wrote:
Hi, I'm new to packaging java applications and I've stumbled upon a small problem: first, how do I request openjdk >= 16 without naming it explicitly? BuildRequires: java-devel >= 16
for building
I tried that. Now javac defaults to 11
Requires: java >= 16
for runtime
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.
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? Thanks
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.
Fridrich Strba wrote:
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.
That did the trick, TYVM.
participants (2)
-
Fridrich Strba
-
Luigi Baldoni