IntelliJ 给出致命错误:无法在类路径或引导类路径中找到包 java.lang [英] IntelliJ gives Fatal Error: Unable to find package java.lang in classpath or bootclasspath

查看:29
本文介绍了IntelliJ 给出致命错误:无法在类路径或引导类路径中找到包 java.lang的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 IntelliJ 中创建一个简单的模块时,它会响应:

When I try to make a simple module in IntelliJ it responds with:

Fatal Error: Unable to find package java.lang in classpath or bootclasspath

推荐答案

以某种方式从类路径中删除了 JDK 语言 jar.我所要做的就是重新应用 JSDK 主路径.

Somehow the JDK language jars were removed from the classpath. All I had to do was reapply the JSDK home path.

转到:文件 -> 项目结构 -> 平台设置 -> SDK重新应用 JSDK 主路径.

Goto: File -> Project Structure -> Platform Settings -> SDKs Re-apply the JSDK home path.

这样做会向类路径添加大约 15 个 jar.显然这些对于编译很重要.

Doing this added about 15 jars to the classpath. Apparently these are important for compiling.

这篇关于IntelliJ 给出致命错误:无法在类路径或引导类路径中找到包 java.lang的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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