How to use Java11 (Java10) with Eclipse Plugin?

后端 未结 3 1030
遇见更好的自我
遇见更好的自我 2021-01-02 11:26

If I specify JavaSE-10 as minimum execution environment in my Eclipse plugin:

I get following errors when starting my plugin as Eclipse Application:

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 11:44

    Since OSGi 4.3, the most appropriate way to specify a minimum Java version is using the Required-Capability header, as in:

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

    I have had success fixing the reported error by replacing all occurrences of Bundle-RequiredExecutionEnvironment with the above line. In PDE, you may get a warning on the manifest file, but it can be safely ignored. Product validation and product exports seems to work without issue.

    The semantic of the BREE header required that an execution environnement descriptor be provided by the OSGi implementation for each specific release of the JRE. In Equinox, this used to be defined through ".profile" files; these profiles have been supported by Equinox up to JavaSE-9, but it has been announced that Equinox they would no longer provide profiles for newer releases of Java.

    The Tycho community has handled this issue on their side by creating their own Java 10 profile, but it can't be used directly from PDE. The P2 community is considering copying Tycho's Java 10 profile, but this has been stalled for a long time. I'm not sure how P2 reacts at present when fed bundles that do not contains the BREE header.

提交回复
热议问题