-
Notifications
You must be signed in to change notification settings - Fork 861
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
java.lang.IllegalAccessError: class com.google.googlejavaformat.java.JavaInput #787
Comments
Taken from #779 a less-than-ideal workaround is to add these JVM arguments to intellij
You can find instructions here https://www.jetbrains.com/help/idea/tuning-the-ide.html#374b2f00 for me on macOS the file was Update: best way to find this file is from the menus: Help > Edit Custom VM Options |
@chadselph I tried this on |
Happens to me on a java11 project and the VM options solved it. Im using 2022.2 EAP right now |
I can confirm that adding the VM options solves the problem for |
Same error on IntelliJ 2022.2 and JDK Sap Machine 11 |
Had the issue after upgrading to 2022.2 (Community Edition), and this workaround solved it. |
Fwiw, the arguments used to run tests, and put into the JAR manifest, are a bit different, so I'd rather use those:
|
I use: IntelliJ IDEA 2022.2, it can be used after modifying it in the following way. Help - Edit Custom VM Options
|
Facing the same issue
|
Same issue. Community Edition 2022.2, build #IC-222.3345.118
|
After I added this configuration it worked fine, thank you! |
I reported this problem to jetbrains, in https://youtrack.jetbrains.com/issue/IDEA-298748/Google-Java-Formatter-plugin-broken-after-IDE-update, and they sent me here. It's true that adding the exports and opens works in the latest IntelliJ with Java 11 and Java 17. But Java 8 doesn't recognize the flags, and throws an exception. Yet removing the flags causes GJF to blow up with the illegal-access error, on Java 8 projects. Which is a catch-22: flags aren't compatible with Java 8, but removing them causes the exception. It appears something went wrong in GJF where it requires the flags regardless of Java version. |
It's worth mentioning that this issue happens when Intellij itself runs with JDK 17. Only if that's the case you would need to add the additional JVM options mentioned in #787 (comment) |
Thanks for this useful workaround, set mine to use my local OpenJDK 11 and it seems to work fine now. |
it works |
fyi: the add-VM args works also for Eclipse (STS 4.16.1.RELEASE) |
Perhaps it's a good idea to catch
at some code located in
😉 |
This did not work on IntelliJ IDEA 2022.3.1 (Ultimate Edition), intelliJ stopped opening, and had to remove these options directly from the file in order to start the iDE. |
I have the same issue. I easily fix this by changing from JAVA JDK 17 to JAVA JDK 8. EDIT: |
Doing this caused Intellij to shut down and now it won't start. |
WORKS ! |
There's not a good way to avoid the I think that's about the best we can do, so I'm going to mark this fixed for now. Thanks. |
Yes, It caused my IDE not starting up. To revert to old setup, delete the idea.jdk or idea64.jdk file in the config directory and then start the IDE. Config directory path for IntelliJ in different OS is listed here. |
→ https://github.com/google/google-java-format#intellij-jre-config (and maybe also update to the latest version of the plugin) |
Latest plugin with all the configs still broken for me. |
seeing a similar problem with a different module in googlejavaformat library
I added the below workaround, but no luck. I'm on IntelliJ IDEA 2023.2.5. any advice?
also note, I am also experiencing this outside of intellij when building. I tried adding the above workaround to my
java version
|
adding jvm options is not a solution, it is a workaround |
Information
Exception
The text was updated successfully, but these errors were encountered: