Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation

后端 未结 16 2182
天命终不由人
天命终不由人 2020-12-01 02:50

Even though I manually configured JDK project structure file/Project structure it still shows this error FAILURE: Build failed with an exception.

`What went wrong:

16条回答
  •  失恋的感觉
    2020-12-01 03:02

    My issue was two-fold:

    1. I had the JRE installed, but not the JDK.
    2. I did not have a JAVA_HOME environment variable set.

    Note: I am using Fedora Linux.

    To resolve the first issue, I followed these instructions

    To resolve the second, I merely added the following line to my ~/.bashrc file:

    export JAVA_HOME=/usr/lib/jvm/java/
    

    I had to restart my IDE and terminals to ensure the change to the ~/.bashrc took affect.

提交回复
热议问题