JShell won't run - missing main class

Answered

Trying to run JShell in IntelliJ 2019.2.1, but I get this in the Run console:

"/Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home/bin/java" -classpath "/Applications/IntelliJ IDEA.app/Contents/lib/jshell-frontend.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/java/lib/jshell-protocol.jar" com.intellij.execution.jshell.frontend.Main
Error: Unable to initialize main class com.intellij.execution.jshell.frontend.Main
Caused by: java.lang.NoClassDefFoundError: jdk/jshell/Snippet$Status
4 comments
Comment actions Permalink

Don't use JetBrains Runtime for development, change your project JDK to a real JDK in the Project Structure dialog.

1
Comment actions Permalink

Thank-you! That worked. I wondered why I had an 11.0.3 version of the JDK and had not noticed it was built-in.

0
Comment actions Permalink

Could you provide an example of how to "change your project JDK to a real JDK in the Project Structure dialog" ? Thank you

0
Comment actions Permalink

@Carlchua0701 please see Change project SDK.

0

Please sign in to leave a comment.