Skip to content
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

InaccessibleObjectException with jdk9 jigsaw b136 #723

Closed
eriwen opened this issue Oct 19, 2016 · 3 comments
Closed

InaccessibleObjectException with jdk9 jigsaw b136 #723

eriwen opened this issue Oct 19, 2016 · 3 comments

Comments

@eriwen
Copy link
Contributor

eriwen commented Oct 19, 2016

From https://discuss.gradle.org/t/jigsaw-b136-gradle-problem/19580

This is with gradle 3.0 and jdk9 jigsaw b136:

Stacktrace [12:00:28][Gradle failure report] Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected java.lang.Package[] java.lang.ClassLoader.getPackages() accessible: module java.base does not "exports private java.lang" to unnamed module @6ca18a14 [12:00:28][Gradle failure report] at java.base/jdk.internal.reflect.Reflection.throwInaccessibleObjectException(Reflection.java:414) [12:00:28][Gradle failure report] at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:196) [12:00:28][Gradle failure report] at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:192) [12:00:28][Gradle failure report] at java.base/java.lang.reflect.Method.setAccessible(Method.java:186) [12:00:28][Gradle failure report] at org.gradle.internal.reflect.JavaMethod.(JavaMethod.java:34) [12:00:28][Gradle failure report] at org.gradle.internal.reflect.JavaMethod.(JavaMethod.java:38) [12:00:28][Gradle failure report] at org.gradle.internal.reflect.JavaReflectionUtil.method(JavaReflectionUtil.java:224) [12:00:28][Gradle failure report] at org.gradle.internal.classloader.FilteringClassLoader.(FilteringClassLoader.java:49)[12:00:28][Gradle failure report] ... 46 more

https://mail-archives.apache.org/mod_mbox/groovy-dev/201609.mbox/%3CCADQzvmn_NqB843%3DTVJFvZww7KDcEgxG2Xsr5dDHWkLtq_ZMXEg%40mail.gmail.com%3E

@eriwen eriwen added the a:bug label Oct 19, 2016
@adammurdoch
Copy link
Member

On Java 9 we can now use the public ClassLoader.getDefinedPackages() instead of using reflection to get at the protected ClassLoader.getPackages().

There's a quick hacky fix for this in this branch: https://github.com/gradle/gradle/tree/am-jigsaw-hacks

@McPringle
Copy link

A few weeks later there is still the same problem with OpenJDK 9 build 150 and Gradle 3.3-rc-1. Even more worse: I can't find any information about the actual status of Gradle and JRE 9 or a timeline. Gradle really needs to run on JRE 9 soon – we can be happy that Oracle had to postpone the release of JDK 9 once more…

@oehme
Copy link
Contributor

oehme commented Oct 5, 2018

This was fixed in 4.10.

@oehme oehme closed this as completed Oct 5, 2018
@oehme oehme added this to the 4.10 RC1 milestone Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants