https://bugzilla.redhat.com/show_bug.cgi?id=1810950
Bug ID: 1810950
Summary: Maven package requires JDK 8 specifically and ignores
alternatives
Product: Fedora
Version: rawhide
Hardware: All
OS: Linux
Status: NEW
Component: maven
Severity: medium
Assignee: stewardship-sig(a)lists.fedoraproject.org
Reporter: tristandeloche(a)gmail.com
QA Contact: extras-qa(a)fedoraproject.org
CC: decathorpe(a)gmail.com,
java-sig-commits(a)lists.fedoraproject.org,
mhroncok(a)redhat.com, mizdebsk(a)redhat.com,
msrb(a)redhat.com, sochotni(a)redhat.com,
stewardship-sig(a)lists.fedoraproject.org
Target Milestone: ---
Classification: Fedora
Description of problem:
Version-Release number of selected component (if applicable): at least since
Fedora 31
How reproducible: always reproducible
Steps to Reproduce:
1. Install any JDK package that's not 8 (and its "-devel" version)
2. Install maven package (which requires JDK 8)
3. Set the "java" and "javac" alternatives to that other JDK
4. Check "mvn -v", see that it still uses JDK 8 forcefully
Actual results:
Maven is executed with JDK 8
Expected results:
Maven is executed with the JDK set using alternatives (reasonably the one of
"javac", but maybe should be another alternative alias as its a jdk reference
rather than one to the javac binary)
Additional info:
Assuming no JAVA_HOME, no .mavenrc etc, the /usr/bin/mvn script has the
following line:
if [ -f /usr/share/java-utils/java-functions ] ; then
. /usr/share/java-utils/java-functions
set_jvm
set_javacmd
fi
And in /usr/share/java-utils/java-functions we have, amongst others:
...
case "${_prefer_jre}" in
1|[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee])
dirs="/usr/lib/jvm/jre-1.8.0-openjdk:/usr/lib/jvm/java-1.8.0-openjdk"
;;
*)
dirs="/usr/lib/jvm/java-1.8.0-openjdk:/usr/lib/jvm/jre-1.8.0-openjdk"
;;
esac
...
Meaning that assuming no override, we will always use the JDK 8 installed as a
dependency of maven, ignoring any user system-wide Java alternative setting.
--
You are receiving this mail because:
You are on the CC list for the bug.