Intellij从不建议使用Java库 [英] Intellij never suggest Java libraries

查看:95
本文介绍了Intellij从不建议使用Java库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Intellij在我的代码上使用List和Set。
但是Intellij只建议maven库下的类,而不是JDK。

I was trying to use List and Set on my code using Intellij. But Intellij only suggest classes under maven libraries, not JDK.

我只能通过在文件顶部手动输入import来使用Java Collections(List,Set)。如此不方便..请帮助

I can only use Java Collections(List, Set) by manually typing imports on the top of the file. so inconvenient.. please help

推荐答案

验证Project SDK已设置:

Verify that Project SDK is set:


  1. 打开项目结构文件 - > 项目结构......

  2. 项目设置 - > 项目

  3. 确认您已设置 Project SDK

  1. Open Project Structure File -> Project Structure...
  2. Project Settings -> Project
  3. Verify that you have a Project SDK set up.

或者,尝试并尝试创建一个简单的Java应用程序,看看问题是否仍然存在。然后,尝试重新导入maven项目。

Alternatively, try and create a simple Java Application and see if the problem persists. Then, try to re-import the maven project.

希望这会有所帮助:)

这篇关于Intellij从不建议使用Java库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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