Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 11 JShell inside Intellij IDEA

I have Java 11 JDK and IntelliJ IDEA 2018.2.4 (64-bit). When I was using Java 10.0.2, the JShell console in IntelliJ IDEA worked fine. Now that I've upgraded to Java 11, the JShell console has stopped working. Nothing at all happens when I click on the Run button or when I hit Ctrl+Enter (see screenshot).

My projects compile and run just fine using Java 11 - it's only the JShell console that doesn't work. (Also, JShell works fine from the Command Prompt, it's only inside IDEA that it doesn't work.) I can reproduce this issue on two machines, one at home running IDEA Community Edition 2018.2.4 and the other at work running Ultimate 2018.2.3.

Is there some configuration I need to do in order to fix this?

screenshot

like image 260
Klitos Kyriacou Avatar asked Oct 06 '18 14:10

Klitos Kyriacou


People also ask

Does the IntelliJ have a JShell?

JShell ConsoleIntelliJ IDEA includes a basic console for working with JShell from inside the IDE, similar to the Groovy Console. You can use the JShell Console to try out code snippets, which can even reference the classes defined in your project.


1 Answers

This seems like a bug registered with JetBrains - IDEA-197466 (reported on version 2018.3)

The reason mostly as it looks like is because of the --add-modules java.xml.bind there.

Since the module java.xml.bind no more exists in the JDK/11.

Edit: As verified by OP, this has been resolved in 2018.3 version of IntelliJ.

like image 70
Naman Avatar answered Sep 20 '22 17:09

Naman