Software⏱️ 2 min read📅 2026-05-31

How to Fix: IntelliJ gives Fatal Error: Unable to find package java.lang in classpath or bootclasspath

IntelliJ error unable to find package java.lang in classpath or bootclasspath, solution involves checking project structure and dependencies.

Quick Answer: Check if the Java Standard Library is included in your project's classpath.

The error message 'Fatal Error: Unable to find package java.lang in classpath or bootclasspath' in IntelliJ indicates that the Java Standard Library is not properly configured. This can occur due to various reasons, such as a missing JRE installation, incorrect JRE path settings, or an outdated JDK version.

🔍 Why This Happens

  • [Cause]

🛠️ Step-by-Step Verified Fixes

Method 1: Update JDK Version

  1. Step 1: Go to File > Project Structure and select the 'Project' tab.

Method 2: Verify JRE Path

  1. Step 1: Go to File > Project Structure and select the 'Project' tab, then click on the 'Libraries' button.

💡 Conclusion

By following these steps, you should be able to resolve the 'Fatal Error: Unable to find package java.lang in classpath or bootclasspath' issue and successfully build your project.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions