Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Migrating a project to modules(It is still a real pain)
Migrating a project to modules [message #1855438] Fri, 14 October 2022 08:54 Go to next message
Julian Ragan is currently offline Julian RaganFriend
Messages: 5
Registered: July 2020
Junior Member
I thought java modules should have matured by now, so I have decided to try and migrate a testing project to modules. Boy was I wrong.

Is there an Eclipse focused guide to Java modules? Especially the troubleshooting part? When going outside the arbitrary boundaries of that system?

Right now I am stuck at getting to work again with sun.font package. And I can't figure out, how to solve this:

Unable to make private sun.font.Font2D java.awt.Font.getFont2D() accessible: module java.desktop does not "opens java.awt" to module FontEncoder

I have added to run VM arguments:
--add-exports java.desktop/sun.font=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED

And now I am all out of google results. I am trying to run it with jdk17
(which supposedly still changes behavior of modules system to more strict enforcement).
Re: Migrating a project to modules [message #1855439 is a reply to message #1855438] Fri, 14 October 2022 10:01 Go to previous messageGo to next message
Jay Arthanareeswaran is currently offline Jay ArthanareeswaranFriend
Messages: 128
Registered: July 2009
Senior Member
Can you see if the following page provides what you are looking for?

https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-properties-build-path.htm&anchor=module-dependencies
Re: Migrating a project to modules [message #1855440 is a reply to message #1855439] Fri, 14 October 2022 10:51 Go to previous messageGo to next message
Julian Ragan is currently offline Julian RaganFriend
Messages: 5
Registered: July 2020
Junior Member
No, it does not. It explains how Eclipse supports java modules, so it assumes I know all about modules already. Also there is nothing about troubleshooting issues common to migrating a project to modules.

What I was looking for was something that would explain to me at the same time java modules and eclipse support for it along with troubleshooting information. But the more I explore the problem, the more it seems that JDK people decided, that if I want to do something, that was possible only through unsupported JDK internals, I absolutely have to write my own library for that, or find another third party library. And they are using java modules to enforce their decision.
Re: Migrating a project to modules [message #1855443 is a reply to message #1855440] Fri, 14 October 2022 11:21 Go to previous message
Julian Ragan is currently offline Julian RaganFriend
Messages: 5
Registered: July 2020
Junior Member
I have somehow managed to make it run on java 17.

Just changed the VM arguments to:
--add-opens java.desktop/sun.font=FontEncoder --add-opens java.desktop/java.awt=FontEncoder

Seems I have to be specific about the module, that will be using JDK internals in modules. I really don't get it.
Previous Topic:Special character issue in Photon and Oxygen
Next Topic:Maven projects created with J2SE-1.5
Goto Forum:
  


Current Time: Sat Apr 20 03:08:33 GMT 2024

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

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

Back to the top