Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Inquiry About Support for Java 21
Inquiry About Support for Java 21 [message #1864819] Thu, 11 April 2024 05:12 Go to next message
Maduranga Siriwardena is currently offline Maduranga SiriwardenaFriend
Messages: 6
Registered: April 2013
Junior Member
We have been using Equinox as the OSGi implementation in our product. We are currently in the process of updating our product to be compatible with Java 21, which involves compiling our code with the source version set to 21. This change understandably introduces the following requirement into our bundles' manifests:

Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=21))"


After updating to the latest Equinox version, upon attempting to install features in our product during the build process, we've encountered an issue where the installation fails due to the unavailability of this capability. A programmatic inspection of the available capabilities revealed support up to Java SE 17 only, as shown below:

osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0.0,1.1.0,1.2.0,1.3.0,1.4.0,1.5.0,1.6.0,1.7.0,1.8.0,9.0.0,10.0.0,11.0.0,12.0.0,13.0.0,14.0.0,15.0.0,16.0.0,17.0.0"


Based on this, we assume that the latest version of Equinox does not yet support Java SE 21. We would greatly appreciate any insights or confirmations regarding this assumption. Additionally, if Equinox does not currently support Java 21, is there a projected timeline for when support might be introduced? Ensuring compatibility with Java 21 is critical for our product's development strategy, and any information or guidance on this matter would be incredibly helpful.

Thank you for your support and looking forward to your guidance.
Re: Inquiry About Support for Java 21 [message #1864823 is a reply to message #1864819] Thu, 11 April 2024 12:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33222
Registered: July 2009
Senior Member
Are you sure the product you are installing into isn't running with a Java 17 JRE/JDK? Running with Java 21 and requiring Java 21 is definitely supported and definitely works. All of these products do exactly that:

https://download.eclipse.org/technology/epp/staging/


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Inquiry About Support for Java 21 [message #1864824 is a reply to message #1864823] Thu, 11 April 2024 13:17 Go to previous messageGo to next message
Maduranga Siriwardena is currently offline Maduranga SiriwardenaFriend
Messages: 6
Registered: April 2013
Junior Member
Running with Java 17 and 21 is working fine.

But the concern is with compiling the product with Java 21. As I mentioned before, when I set the source version in compiler plugin to 21, it adds below require capability which is expected.

Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=21))"

But as I can see this capability is not available in the current OSGi environment. If you think this should be available, can you please provide some pointers for me to debug my issue.

When you say products in below link are working with Java 21, is there a specific reason to pointing to staging products?
https://download.eclipse.org/technology/epp/staging/
Re: Inquiry About Support for Java 21 [message #1864825 is a reply to message #1864823] Thu, 11 April 2024 13:38 Go to previous messageGo to next message
Maduranga Siriwardena is currently offline Maduranga SiriwardenaFriend
Messages: 6
Registered: April 2013
Junior Member
Can you also point me to a source code repository of a product in https://download.eclipse.org/technology/epp/staging/ that is compiling with Java 21?
Re: Inquiry About Support for Java 21 [message #1864833 is a reply to message #1864825] Fri, 12 April 2024 07:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33222
Registered: July 2009
Senior Member
Those products come from this repository:

https://github.com/eclipse-packaging/packages

The statement that "this capability is not available in the current OSGi environment" is not correct. The runtime synthesizes the profile details from the running environment.

Most likely the failure you see is one from p2 and for that case, the installation relies on the a.jre.javase IUs available in some p2 repository.

index.php/fa/44138/0/

The Tycho build can generates just IUs into the repository. I forget the details...


Ed Merks
Professional Support: https://www.macromodeling.com/

[Updated on: Fri, 12 April 2024 07:15]

Report message to a moderator

Re: Inquiry About Support for Java 21 [message #1864883 is a reply to message #1864833] Thu, 18 April 2024 07:51 Go to previous messageGo to next message
Maduranga Siriwardena is currently offline Maduranga SiriwardenaFriend
Messages: 6
Registered: April 2013
Junior Member
Do you have any reference to understand how the tycho build generate this in the repository? My build seems to be generating the IU for Java 17 only though I have not set any parameter related to Java 17 specifically.
Re: Inquiry About Support for Java 21 [message #1864887 is a reply to message #1864883] Thu, 18 April 2024 14:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33222
Registered: July 2009
Senior Member
No, I'm not sure. Docs are here:

https://tycho.eclipseprojects.io/doc/latest/
https://tycho.eclipseprojects.io/doc/latest/tycho-p2-repository-plugin/plugin-info.html

You could ask about it here:

https://github.com/eclipse-tycho/tycho/discussions

(Maybe you have to run the build with Java 21.)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Inquiry About Support for Java 21 [message #1864941 is a reply to message #1864887] Sat, 20 April 2024 16:19 Go to previous message
Maduranga Siriwardena is currently offline Maduranga SiriwardenaFriend
Messages: 6
Registered: April 2013
Junior Member
I finally figured it out. It was due to the outdated dependency of org.eclipse.equinox.p2.publisher component in the p2 maven plugin we created to work with p2 repository.

JREAction.java is supposed to actually generate the a.jre.javase IU and it was by default using Java 17. But with https://github.com/eclipse-equinox/p2/pull/462, it is now properly generating the IU for the current Java version and Java 21 IU is now properly generated.

Thank you for the support and pointers provided.

[Updated on: Sat, 20 April 2024 17:02]

Report message to a moderator

Previous Topic:p2.inf instructions don't use newly updated plugin, instead use the currently installed version
Goto Forum:
  


Current Time: Sat Oct 05 05:38:38 GMT 2024

Powered by FUDForum. Page generated in 0.05298 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top