简体   繁体   English

Intellij无法解析Java包

[英]Intellij can't resolve Java packages

I'm trying to set up my Intellij plugin project on arch linux. 我正在尝试在Arch Linux上设置我的Intellij插件项目。 Somehow intelliJ does not want to scan the dependencies. 某种程度上,intelliJ不想扫描依赖关系。

I tried to use java 8 JDK, did not work. 我试图使用Java 8 JDK,没有用。 Invalidated caches. 无效的缓存。 Recreated the project. 重新创建了项目。

DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=18.0.4
DISTRIB_CODENAME=Illyria
DISTRIB_DESCRIPTION="Manjaro Linux"

IntelliJ IDEA 2018.3.6 (Ultimate Edition)
Build #IU-183.6156.11, built on March 25, 2019
Licensed to IntelliJ IDEA Evaluator
Expiration date: July 25, 2019
JRE: 1.8.0_152-release-1343-b28 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.19.49-1-MANJARO 

(The 2 Problems from the screenshots are from Python, which is somehow in several projects and I don't think this is related) (屏幕快照中的2个问题来自Python,这在几个项目中都是以某种方式出现的,我认为这并不相关)

How can i fix this? 我怎样才能解决这个问题?

在此处输入图片说明 项目JDK 模块依赖

Something wrong JDK configuration. JDK配置错误。 Click the 'New...' button next to the JDK text box and configure. 单击JDK文本框旁边的“新建...”按钮并进行配置。

在此处输入图片说明

I had the same issue. 我遇到过同样的问题。 In my case the plugin is built correctly from command line using Gradle but IntelliJ is unable to resolve dependencies on standard classes when I import the project. 在我的情况下,该插件是使用Gradle从命令行正确构建的,但是在导入项目时IntelliJ无法解析对标准类的依赖关系。

I managed to find only a workaround . 我设法找到一种解决方法 It worked with JDK 11. You can specify JDK 11 in IntelliJ, use it for development but you can still build the project form command line using the version you want. 它与JDK 11一起使用。您可以在IntelliJ中指定JDK 11,将其用于开发,但仍可以使用所需版本来构建项目表单命令行。

You might also want to compare your configuration with the one I used in my plugin . 您可能还想将配置与我在插件中使用的配置进行比较。

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

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