简体   繁体   English

Intellij IDEA 中的 Java 11 JShell

[英]Java 11 JShell inside Intellij IDEA

I have Java 11 JDK and IntelliJ IDEA 2018.2.4 (64-bit).我有 Java 11 JDK 和 IntelliJ IDEA 2018.2.4(64 位)。 When I was using Java 10.0.2, the JShell console in IntelliJ IDEA worked fine.当我使用 Java 10.0.2 时,IntelliJ IDEA 中的 JShell 控制台运行良好。 Now that I've upgraded to Java 11, the JShell console has stopped working.现在我已经升级到 Java 11,JShell 控制台已经停止工作。 Nothing at all happens when I click on the Run button or when I hit Ctrl+Enter (see screenshot).当我单击“运行”按钮或按 Ctrl+Enter 时,什么也没有发生(见截图)。

My projects compile and run just fine using Java 11 - it's only the JShell console that doesn't work.我的项目使用 Java 11 编译和运行得很好 - 只有 JShell 控制台不起作用。 (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. (另外,JShell 在命令提示符下工作正常,只有在 IDEA 内部它不起作用。)我可以在两台机器上重现这个问题,一台在家里运行 IDEA Community Edition 2018.2.4,另一台在工作时运行 Ultimate 2018.2 .3.

Is there some configuration I need to do in order to fix this?为了解决这个问题,我需要做一些配置吗?

截屏

This seems like a bug registered with JetBrains - IDEA-197466 (reported on version 2018.3 )这似乎是在JetBrains 中注册的错误- IDEA-197466 (在2018.3版上报告

The reason mostly as it looks like is because of the --add-modules java.xml.bind there.原因主要是因为那里的--add-modules java.xml.bind

Since the module java.xml.bind no more exists in the JDK/11 .由于模块java.xml.bind在 JDK/11 中不再存在

Edit : As verified by OP , this has been resolved in 2018.3 version of IntelliJ.编辑经 OP 验证,这已在 IntelliJ 2018.3 版本中得到解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM