Unable to use Shenandoah on intellij

Answered

I've been benchmarking a few GC from different VMs. When it comes to Shenandoah, after running my project through intellij, it gives me this error message:

I'm using "-XX:+UseShenandoahGC" VM Option in my run settings.

When running my application through maven, the project compiles with no error.

Also, I've tried to add a custom JRE image into intellij:

https://github.com/JetBrains/JetBrainsRuntime/tree/248%2Bshenandoah

From: 

https://youtrack.jetbrains.com/issue/JBR-667

 

Although I've had no success. Long story short, how can I make Shenandoah work within IntelliJ?

 

Thanks

 

11 comments
Comment actions Permalink

JetBrains Runtime and your project JDK are unrelated.

If you want to use it in your project, change the project JDK to the one supporting this option.

0
Comment actions Permalink

Not sure whether that's the case:

 

 

 

Just in case, I'll be adding some IntelliJ info, idk if it might help

 

0
Comment actions Permalink

It looks like OpenJDK you have installed doesn't support this option.

Try corretto-17.0.3.

Your question is not related to IntelliJ IDEA at all.

0
Comment actions Permalink

It's not what it looks like since Shenandoah perfectly works on this very same version when running with Maven instead of running it with IntelliJ. It was mentioned before:

"When running my application through maven, the project compiles with no error."

 

 

0
Comment actions Permalink

"When running my application through maven, the project compiles with no error."

Compiling and running are 2 different things. I don't think Maven compiler is instructed to use this unsupported JVM option. It's also possible that Maven is using a different JDK in the command line.

Run your JDK like this in the command line:

java -XX:+UseShenandoahGC -version

Do you get the same error?

Now repeat it with Amazon Corretto JDK 17.0.3 where it should work.

0
Comment actions Permalink

Touché. Trying it with the suggested Amazon Corretto version.

0
Comment actions Permalink

I still get the same prompt message when running the command below in my root project directory

java -XX:+UseShenandoahGC -version

Everything seems to be in place:

Any thoughts on that?

 

Although this time running the application through IntelliJ worked like a charm. 

I think it's safe to say that the problem had nothing to do with IntelliJ. What's weird to me is that, according to OpenJDK, the version that was being used earlier should have worked as well:

http://wiki.openjdk.java.net/display/shenandoah/Main 

 

 

 

 

0
Comment actions Permalink

> Any thoughts on that?

As far as I can see, the error about the unsupported VM option has gone. So what is the problem?

> I think it's safe to say that the problem had nothing to do with IntelliJ. What's weird to me is that, according to OpenJDK, the version that was being used earlier should have worked as well

It's likely this information is no longer accurate, feel free to contact OpenJDK maintainers and ask to fix it.

0
Comment actions Permalink

> As far as I can see, the error about the unsupported VM option has gone. So what is the problem?

java -XX:+UseShenandoahGC -version

It still prompting the same error:

 

But that's alright, I know it is working by that:

 

Maybe invalidating caches/restarting IntelliJ should fix it.

Thank you a lot for your assistance.

0
Comment actions Permalink

If you changed your PATH with the new JDK version, logout/login or reboot is required for all the apps to see this change.

Test with the absolute java.exe path and you will see that it works.

Once again, it's not related to IntelliJ IDEA and this forum was not the correct place to report this problem / ask for help.

0
Comment actions Permalink

Ok, my apologies for that. Again, thank you for your support, it was very helpful and instructive.

0

Please sign in to leave a comment.