-
Notifications
You must be signed in to change notification settings - Fork 146
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
Support JDKs with strong encapsulation #91
Comments
I'm also getting the same with
|
Here is a general article about running the Chronicle libraries under Java 17. Perhaps there are some findings there you can apply? |
Thx @minborg, it helps. In the end, for this module, I only had to add |
@minborg, has this actually be fixed (because I don't see any related changes on |
This is a known issue and will be addressed in a later release. |
@minborg out of curiosity, what can be done from the lib point of view to improve this? I've tried looking into this, and never really understood how this work except for authorizing those kind of accesses from the runtime JVM with |
Generally speaking, an obvious way to reduce problems like this is to remove the use of reflection (on objects that are not exported by the module system). Support for the module system itself is another way to improve library quality. That said, Java 8 does not support the module system. |
Indeed ^^
Ah that's what I am interested in. So it is possible for the lib to include some configuration that says it uses some closed APIs (such as the one discussed above) and it will work out of the box? |
@minborg, would you mind reopening this issue? This problem still does not seem to be solved in the latest version, and I find it a bit weird / confusing to close an issue for a problem which is still unresolved (the solutions mentioned above are only workarounds). I don't want to rush you in any way; I just think it would be more transparent to keep this issue open until the problem is solved. This will also make it easier for others to find this issue. |
Recent JDK versions, such as JDK 17, strongly encapsulate their internals, see JEP 403.
Therefore using your library fails for these versions by default because the internal JDK fields are not accessible:
This can be worked around by using
--add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
, but that is rather cumbersome and brittle.Would it be possible for this library to not rely on JDK internals (possibly at the cost that the user has to provide additional arguments)?
The text was updated successfully, but these errors were encountered: