I reopen the issue #88, with the future changes in fedora (remove maven-local-openjdk8) the solution proposed will not applicable in future. Here the initial post, please provide the possibility to change the JDK used with maven-local.
Before, for building openjfx8 these instructions was sufficient to build with maven and openjdk 1.8:
Now, on rawhide (f35), the JVM will always be replaced by the default JVM (openjdk 11) by the script mvn_build.py.
In debug mode, I saw that mvn_build.py build that command to start the build:
xmvn --batch-mode --offline --debug -Dxmvn.debug verify org.fedoraproject.xmvn:xmvn-mojo:install org.fedoraproject.xmvn:xmvn-mojo:javadoc org.fedoraproject.xmvn:xmvn-mojo:builddep
The output is (begin):
Apache Maven 3.6.3 (Red Hat 3.6.3-8)
Maven home: /usr/share/xmvn
Java version: 11.0.11, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-4.fc34.x86_64
Now if I try to change JAVA_HOME before xmvn, the JAVA_HOME is changed:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk && xmvn --batch-mode --offline --debug -Dxmvn.debug verify org.fedoraproject.xmvn:xmvn-mojo:install org.fedoraproject.xmvn:xmvn-mojo:javadoc org.fedoraproject.xmvn:xmvn-mojo:builddep
The output:
Apache Maven 3.6.3 (Red Hat 3.6.3-8)
Maven home: /usr/share/xmvn
Java version: 1.8.0_292, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-4.fc34.x86_64/jre
Could you change the behavior of the mvn_build.py to add the possibility to change the JVM? I could propose a PR if you are ok with a new argument? For example:
%mvn_build --java-home /usr/lib/jvm/java-1.8.0-openjdk
Fundamental Java packaging tools, such as dependency generators and others, will start requiring Java >= 21 in the near future
I have plans to make it easier to use custom/arbitrary Java runtimes with Javapackages. No guarrantee that this will work. Ref: https://issues.redhat.com/browse/RHEL-54070 (You can substitute Fedora for RHEL.)
I reopen the issue #88, with the future changes in fedora (remove maven-local-openjdk8) the solution proposed will not applicable in future. Here the initial post, please provide the possibility to change the JDK used with maven-local.
Before, for building openjfx8 these instructions was sufficient to build with maven and openjdk 1.8:
Now, on rawhide (f35), the JVM will always be replaced by the default JVM (openjdk 11) by the script mvn_build.py.
In debug mode, I saw that mvn_build.py build that command to start the build:
xmvn --batch-mode --offline --debug -Dxmvn.debug verify org.fedoraproject.xmvn:xmvn-mojo:install org.fedoraproject.xmvn:xmvn-mojo:javadoc org.fedoraproject.xmvn:xmvn-mojo:builddep
The output is (begin):
Now if I try to change JAVA_HOME before xmvn, the JAVA_HOME is changed:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk && xmvn --batch-mode --offline --debug -Dxmvn.debug verify org.fedoraproject.xmvn:xmvn-mojo:install org.fedoraproject.xmvn:xmvn-mojo:javadoc org.fedoraproject.xmvn:xmvn-mojo:builddep
The output:
Could you change the behavior of the mvn_build.py to add the possibility to change the JVM? I could propose a PR if you are ok with a new argument? For example:
%mvn_build --java-home /usr/lib/jvm/java-1.8.0-openjdk