[packages/rpm-pld-macros] 2.058; try to get stable java environment (javadoc binaries etc)
Arkadiusz Miśkiewicz
arekm at maven.pl
Mon Apr 20 12:33:20 CEST 2026
On 20/04/2026 12:17, Jan Palus wrote:
>> diff --git a/macros.java b/macros.java
>> index 2c2ef21..80f1bca 100644
>> --- a/macros.java
>> +++ b/macros.java
>> @@ -66,9 +66,10 @@
>> %use_default_jdk() %{expand:%%global use_jdk %{default_jdk %{?*}}}
>>
>> # expands to the value with right jdk for BuildRequires header
>> -# 'jdk' if %%use_jdk is not defined, jdk(%%use_jdk) otherwise
>> -# The requirement will not replace current 'default' JDK
>> -%required_jdk jdk%{?use_jdk:(%{use_jdk})}
>> +# When %%use_jdk is set, require full JDK package (with /usr/bin/javac etc.)
>> +# to ensure correct JDK tools are in PATH when multiple JDK -base packages
>> +# are co-installed.
>> +%required_jdk %{?use_jdk:%{use_jdk}-jdk}%{!?use_jdk:jdk}
>
> Please don't. This was specifically designed not to rely on PATH for any
> java stuff but to use non-conflicting *-base-* packages and JAVA_HOME
> instead.
>
> This change is the reason java-xalan failed today.
>
> If there is an issue with some package I'm even willing to help with
> packaging rather then going back to "BuildRequires: jdk" and packages
> having all sorts of kinky ClassDataVersion because one time jdk11 was
> required for libreoffice and another time jdk23 for eclipse-jdt.
What's the correct approach?
Don't remember which but some package called javadoc binary in build
process and despite %use_default_jdk 8 it used javadoc from some openjdk
2X (as all openjdkXX were installed)
How to make sure that desired paths are set and correct tools are used
without having to audit every call in build system of such package?
(some of these could be building fine but still using incorrect binaries
(vs use_default_jdk setting)).
--
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )
More information about the pld-devel-en
mailing list