1

[Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @fb04536]

3 Answers 3

3

For me what worked was to uninstall all manually installed java versions I mean java installations via installer, or let's say uninstall all java installations at /Library/Java/JavaVirtualMachines/.

  1. run /usr/libexec/java_home -v 1.8.0_06 --exec javac -version to see all currently installed java versions.
  2. run sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk on each of the jdk versions.
  3. Check the JDK location in Android Studio, you can find that under Android Studio > Preferences > Build, Execution, Deployment > Build Tools > Gradle make sure whatever JDK is selected is at the location /Applications/Android Studio.app/Contents/jre/Contents/Home, this is Android Studio's downloaded JDK location, if you can't find the JDK you want to use in the dropdown of downloaded JDKs, use the download JDK button in the dropdown.
  4. try running the application again it should now use the JDK set by android studio.
Sign up to request clarification or add additional context in comments.

Comments

2

If you are working with flutter, I just figured out the solution All I did is to add

org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED

to the gradle.properties file

See this link : How to solve InaccessibleObjectException ("Unable to make {member} accessible: module {A} does not 'opens {package}' to {B}") on Java 9?

Comments

1

If you are working with Android(Java),try lowering the JDK version to 11 or 8(JDK 1.8)

1 Comment

This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.