Eclipse RCP + OpenJDK 11 + internal API [message #1802665] |
Wed, 13 February 2019 15:24 |
Serhiy Davydiuk Messages: 6 Registered: March 2016 |
Junior Member |
|
|
I want to migrate my Eclipse RCP application to Java 11 (OpenJDK 11).
And I have 3 issues related:
1. One of my plugin uses internal non-exported classes from package
com.sun.java.swing.plaf.windows
2. Second one uses jaxb-api classes (module jaxb-api has been removed in Java 9+)
3. Another plugins don't have compile errors related to Java 11
Questions/issues:
1. This post describes how to export internal packages in Eclipse: https://stackoverflow.com/questions/47262810/eclipse-java9-how-to-access-internal-javafx-packages.
But:
- my JRE System Library doesn't have Is Modular node in project properties dialog. So I need to open classpath file and add attribute manually, Then I'm able to add exports through Module Properties dialog
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="module" value="true"/>
<attribute name="add-exports" value="java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED"/>
</attributes>
</classpathentry>
- I can resolve compile errors just adding attribute "add-exports" in classpath file, without specifying JRE as modular:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="add-exports" value="java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED"/>
</attributes>
</classpathentry>
Do we need to specify JRE as modular? Which configuration is correct?
2. This post describes how to resolve removed modules: https://stackoverflow.com/questions/48204141/replacements-for-deprecated-jpms-modules-with-java-ee-apis
I've downloaded jaxb-api plugin and added it to my target platform. Do I need to update BREE in Manifest file and set Java 11 ?
3. For the plugins, that don't have any compile errors related to Java 11 do I need to update java version in Manifest file and set JRE as modular in classpath file every time?
Regards,
Serhii
[Updated on: Thu, 14 February 2019 14:48] Report message to a moderator
|
|
|
|
Re: Eclipse RCP + OpenJDK 11 + internal API [message #1802961 is a reply to message #1802831] |
Tue, 19 February 2019 17:32 |
Serhiy Davydiuk Messages: 6 Registered: March 2016 |
Junior Member |
|
|
Thank you for your reply, Stephan.
Quote:
You didn't mention which version of Eclipse / JDT you are using. If this happens with latest, than this would be a bug. JRE >= 9 should always be recognized as modular
I'm using Eclipse 2018-12 (4.10.0) for Committers, JDT 3.16.
Just created a new Plug-in Project from Templates, JRE hasn't been recognized as modular. Checked the same in Eclipse for RCP devs (4.10, JDT 3.16), JRE has been recognized as modular. It looks like a bug for me.
Quote:
This is strange, modifying modularity details should only have effect for elements on the Modulepath (i.e., Is Modular / "module=true")
Agree, maybe Eclipse recognizes JDK 11 as modular by default, I don't know..
|
|
|
Re: Eclipse RCP + OpenJDK 11 + internal API [message #1802973 is a reply to message #1802961] |
Tue, 19 February 2019 23:26 |
Stephan Herrmann Messages: 1853 Registered: July 2009 |
Senior Member |
|
|
Quote:I'm using Eclipse 2018-12
OK, that's fairly recent :)
Quote:Just created a new Plug-in Project from Templates,
You mean one of the templates offered in the "New Plug-in Project" wizard, like "Hello, World Command"?
I just tried that and it correctly places the JRE on the module path, and the dialog says "Is Modular".
Wait: the "Java Build Path" shows info as expected, but .classpath doesn't need to show the "module" attribute because that information is inferred, indeed.
[Updated on: Tue, 19 February 2019 23:28] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03333 seconds