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

后端 未结 7 1140
悲哀的现实
悲哀的现实 2020-12-02 13:54

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
7条回答
  •  醉酒成梦
    2020-12-02 14:34

    This worked for me:

    In Preferences Build Tools > Maven > Runner > Environment Variables set JAVA_HOME to your JDK home path.

    Usually you want to use the same Java JDK you are using in IntelliJ. You can find that under Project Structure > Platform Settings > SDKs under JDK home path.

    e.g. /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home

提交回复
热议问题