IntelliJ IDEA Ultimate 2018.3认为我的Java 9项目是Kotlin项目 [英] IntelliJ IDEA Ultimate 2018.3 thinks my Java 9 Project is a Kotlin Project

查看:498
本文介绍了IntelliJ IDEA Ultimate 2018.3认为我的Java 9项目是Kotlin项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个IntelliJ项目,该项目由几个子项目组成,这些子项目都是Java 9模块.我使用Maven作为构建系统.我的项目没有"Facets".我的运行配置如下所示:

I have an IntelliJ project composing several subprojects which are all Java 9 modules. I use Maven as a build system. My project has no "Facets". My run configuration looks like this:

我的项目设置如下:

My project settings look like this:

我可以使用Maven构建一切.但是,当我尝试使用IntelliJ进行编译时,它以某种方式认为我的项目是Kotlin项目,无法对其进行编译:

I can build everything with Maven just fine. However, when I try to compile with IntelliJ, it somehow thinks that my project is a Kotlin project and can't compile it:

错误:Kotlin:在模块图中找不到Kotlin标准库.请确保模块定义中包含"requires kotlin.stdlib"子句

Error:Kotlin: The Kotlin standard library is not found in the module graph. Please ensure you have the 'requires kotlin.stdlib' clause in your module definition

有人知道如何解决此问题吗?我已经尝试删除运行配置并重新创建它.这可以解决该问题一段时间,但随后会随机出现.

Has anyone any idea how to fix this? I already tried deleting the run configuration and recreated it. This fixes the problem for some time, but then it reappears randomly.

推荐答案

即使在 2019.1.3 中也存在错误.

一个对我一直有效的解决方案是:

A solution that always works for me is :

Build menu => Rebuild Project

通过JDK 12.0.1测试

Tested with JDK 12.0.1

这个问题应该由IntelliJ小组尽快解决,因为越来越多的Java项目正在传递给JDK 11 ++

That should be fixed though by IntelliJ team as soon as possible as more and more Java projects are passing to JDK 11 ++

这篇关于IntelliJ IDEA Ultimate 2018.3认为我的Java 9项目是Kotlin项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆