fedora-java / javapackages

Macros and scripts for Java packaging support
Other
7 stars 15 forks source link

Build openjfx8 package that needs openjdk 1.8 is impossible #104

Closed deamn closed 1 month ago

deamn commented 1 month ago

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:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
%mvn_build

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

mizdebsk commented 1 month ago

Some quick references/remarks before I can dig more into the issue:

deamn commented 1 month ago

Ok, the target of openjfx8 is to provide JavaFX libraries for OpenJDK8. If OpenJDK8 will be retired in Fedora 42, openjfx8 too. Thanks.