Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWT should require Java 17 runtime in 4.28 #625

Closed
iloveeclipse opened this issue Apr 12, 2023 Discussed in #623 · 6 comments · Fixed by #627 or eclipse-platform/eclipse.platform.swt.binaries#36
Closed

SWT should require Java 17 runtime in 4.28 #625

iloveeclipse opened this issue Apr 12, 2023 Discussed in #623 · 6 comments · Fixed by #627 or eclipse-platform/eclipse.platform.swt.binaries#36
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@iloveeclipse
Copy link
Member

Discussed in #623

I've just noticed that SWT is still requires at least Java 11, even if the almost everything in platform (except equinox) is moved to Java 17.

Note that the Eclipse project Plan for 4.28 only sees Java 17 as supported platform.

We should switch SWT to require Java 17 runtime for 4.28 M2.

I will provide a PR.

@iloveeclipse iloveeclipse added the enhancement New feature or request label Apr 12, 2023
@iloveeclipse iloveeclipse added this to the 4.28 M2 milestone Apr 12, 2023
@iloveeclipse iloveeclipse self-assigned this Apr 12, 2023
@iloveeclipse
Copy link
Member Author

@HannesWell : For ppc64le build, which JVM is to use here:

javaHome = '/usr/lib/jvm/java-11-openjdk-11.0.15.0.10-3.el8.ppc64le'

@iloveeclipse
Copy link
Member Author

Note, we also still have build files that require Java 11, see #626.
Not sure if we can switch sources to Java 17 and still run build with 11.

iloveeclipse added a commit to iloveeclipse/eclipse.platform.swt that referenced this issue Apr 12, 2023
Note: there are still build files requiring Java 11 for execution
(Jenkinsfile and buildSWT.xml).

See eclipse-platform#626

Fixes eclipse-platform#625
@iloveeclipse iloveeclipse added the help wanted Extra attention is needed label Apr 12, 2023
@iloveeclipse
Copy link
Member Author

Currently I'm stuck on some strange Jenkins build results in #627. If anyone has ideas, please comment there.

iloveeclipse added a commit to iloveeclipse/eclipse.platform.swt that referenced this issue Apr 12, 2023
Note: there are still build files requiring Java 11 for execution
(Jenkinsfile and buildSWT.xml).

See eclipse-platform#626

Fixes eclipse-platform#625
@HannesWell
Copy link
Member

@HannesWell : For ppc64le build, which JVM is to use here:

javaHome = '/usr/lib/jvm/java-11-openjdk-11.0.15.0.10-3.el8.ppc64le'

That's a JVM/JDK installed by the EFDN infra team and you want to use another one you have to open a ticket and ask them to add another one tot the build machines dedicated for ppc64le (see https://ci.eclipse.org/releng/label/swt.natives-gtk.linux.ppc64le/), which is at the moment only https://ci.eclipse.org/releng/label/swt.natives-gtk.linux.ppc64le/.

But that and the other JDKs in that part assigned to the JAVA_HOME env variable only provide the headers used for the JNI code.
Since (I assume that) the Java JNI code headers should be equivalent over the Java versions it should be sufficient the leave them untouched. The SWT natives build against the Java-11 headers work with java-17 JRE already and I assume they will do it even when the bundles require java-17.
Nevertheless on the long run those JVMs should be updated. Looking at the win32/library/build.bat it seems that for windows only the SWT_JAVA_HOME is honored, while for other Platforms JAVA_HOME is used:

IF "%SWT_JAVA_HOME%"=="" CALL :ECHO "'SWT_JAVA_HOME' was not provided, auto-searching for JDK..."
@rem Search for generic JDKs so that user can build with little configuration
@rem Note that first found JDK wins, so sort them by order of preference.
IF "%SWT_JAVA_HOME%"=="" CALL :TryToUseJdk "%ProgramFiles%\Java\jdk-11*"
IF "%SWT_JAVA_HOME%"=="" CALL :TryToUseJdk "%ProgramFiles%\AdoptOpenJDK\jdk-11*"
IF "%SWT_JAVA_HOME%"=="" CALL :TryToUseJdk "%ProgramFiles%\Java\jdk-17*"
IF "%SWT_JAVA_HOME%"=="" CALL :TryToUseJdk "%ProgramFiles%\AdoptOpenJDK\jdk-17*"
@rem Report
IF NOT EXIST "%SWT_JAVA_HOME%" (
CALL :ECHO "WARNING: x64 Java JDK not found. Please set SWT_JAVA_HOME to your JDK directory."
CALL :ECHO " Refer steps for SWT Windows native setup: https://www.eclipse.org/swt/swt_win_native.php"
) ELSE (
CALL :ECHO "SWT_JAVA_HOME x64: %SWT_JAVA_HOME%"
)

That's probably something that should be unified.

Note, we also still have build files that require Java 11, see #626. Not sure if we can switch sources to Java 17 and still run build with 11.

The Build stage itself runs with a Java-17 JDK on the PATH already.

jdk 'openjdk-jdk17-latest'

In the stages that perform the SWT natives build respectively check if that is necessary and handle committing etc. Java-11 is indeed required if the ant tasks use javascript. But one of the goals of #513 is to get rid of ANT as much as reasonable possible, which (hopefully) then makes the use of embedded javascript obsolete.
But in the meantime I think we can stay with the current setup, even if the bundles require Java-17 since in the build and test stage Java-17 is used as said above.

Currently I'm stuck on some strange Jenkins build results in #627. If anyone has ideas, please comment there.

Fixed with #628 .

HannesWell pushed a commit to iloveeclipse/eclipse.platform.swt that referenced this issue Apr 12, 2023
Note: there are still build files requiring Java 11 for execution
(Jenkinsfile and buildSWT.xml).

See eclipse-platform#626

Fixes eclipse-platform#625
iloveeclipse added a commit to iloveeclipse/eclipse.platform.swt that referenced this issue Apr 13, 2023
Note: there are still build files requiring Java 11 for execution
(Jenkinsfile and buildSWT.xml).

See eclipse-platform#626

Fixes eclipse-platform#625
iloveeclipse added a commit that referenced this issue Apr 13, 2023
Note: there are still build files requiring Java 11 for execution
(Jenkinsfile and buildSWT.xml).

See #626

Fixes #625
@iloveeclipse
Copy link
Member Author

SDK build failed with https://ci.eclipse.org/releng/job/Builds/job/I-build-4.28/63/console

08:53:30  [INFO] Resolving dependencies of MavenProject: org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:3.124.0-SNAPSHOT @ /home/jenkins/agent/workspace/Builds/I-build-4.28/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/gitCache/eclipse.platform.releng.aggregator/eclipse.platform.swt.binaries/bundles/org.eclipse.swt.win32.win32.x86_64/pom.xml
08:53:30  [ERROR] org.eclipse.swt 3.124.0.qualifier requires Execution Environment that matches (&(osgi.ee=JavaSE)(version=17)) but the current resolution context uses [a.jre.javase 11.0.0]
08:53:30  [INFO] {osgi.os=win32, osgi.ws=win32, org.eclipse.update.install.features=true, org.eclipse.swt.buildtime=true, osgi.arch=x86_64}
08:53:30  [ERROR] Cannot resolve project dependencies:
08:53:30  [ERROR]   Software being installed: org.eclipse.swt.win32.win32.x86_64 3.124.0.qualifier
08:53:30  [ERROR]   Missing requirement: org.eclipse.swt 3.124.0.qualifier requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=17))' but it could not be found
08:53:30  [ERROR]   Cannot satisfy dependency: org.eclipse.swt.win32.win32.x86_64 3.124.0.qualifier depends on: osgi.bundle; org.eclipse.swt [3.124.0,4.0.0)

@laeubi : that seem to be a difference between Jenkins / official build. Where is th eproblem?

iloveeclipse added a commit to eclipse-platform/eclipse.platform.swt.binaries that referenced this issue Apr 13, 2023
Note: there are still build files requiring Java 11 for execution
(Jenkinsfile and buildSWT.xml).

See eclipse-platform/eclipse.platform.swt#626

Fixes eclipse-platform/eclipse.platform.swt#625
@iloveeclipse
Copy link
Member Author

Is that the reason: eclipse-platform/eclipse.platform.swt.binaries#36 ?

@iloveeclipse iloveeclipse reopened this Apr 13, 2023
iloveeclipse added a commit to eclipse-platform/eclipse.platform.swt.binaries that referenced this issue Apr 13, 2023
Note: there are still build files requiring Java 11 for execution
(Jenkinsfile and buildSWT.xml).

See eclipse-platform/eclipse.platform.swt#626

Fixes eclipse-platform/eclipse.platform.swt#625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
2 participants