英文:
"Java home is different." when building gradle project on Intelij
问题
I tried to import a gradle project on InteliJ but I get this error when it's building:
`Java home is different. Expecting: 'C:\Program Files\Java\jdk-1.8'
but was: 'C:\Program Files\Java\jdk-1.8\jre'.Please configure the JDK to match the expected one.
Open JDK Settings`
I understand this error BUT, when i change my JAVA_HOME nothing happened !!! Even if I use SDK 17, the error still " jdk-1.8......". Each time I change JAVA_HOME I check my "java -version".
In case, I give my parameters:
JAVA_HOME:
echo %JAVA_HOME% C:\Program Files\Java\jdk-1.8
My Path :
echo %Path% C:\Program Files\Java\jdk-1.8\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86\;C:\Program Files (x86)\Common Files\Pulse Secure\TNC Client Plugin\;C:\Program Files (x86)\Common Files\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Common Files\Pulse Secure\VC142.CRT\X86\;C:\Users\a904778\Downloads\apache-ant-1.9.16-bin\apache-ant-1.9.16\bin;C:\Users\a904778\Downloads\apache-ant-1.9.16-bin\apache-ant-1.9.16\bin;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Users\a904778\AppData\Local\Microsoft\WindowsApps;C:\Users\a904778\Downloads\gradle-3.0-bin\gradle-3.0\bin;
PS: I even tried to unistall/ install InteliJ but same error.
I checked ALL the forum before and nothing worked.
英文:
I tried to import a gradle project on InteliJ but I get this error when it's building :
> Java home is different. Expecting: 'C:\Program Files\Java\jdk-1.8'
> but was: 'C:\Program Files\Java\jdk-1.8\jre'.
>
> Please configure the JDK to match the expected one.
>
> Open JDK Settings
I understand this error BUT, when i change my JAVA_HOME nothing happened !!! Even if I use SDK 17, the error still " jdk-1.8......". Each time I change JAVA_HOME I check my "java -version".
In case, I give my parameters:
JAVA_HOME:
echo %JAVA_HOME%
C:\Program Files\Java\jdk-1.8
My Path :
echo %Path%
C:\Program Files\Java\jdk-1.8\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86\;C:\Program Files (x86)\Common Files\Pulse Secure\TNC Client Plugin\;C:\Program Files (x86)\Common Files\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Common Files\Pulse Secure\VC142.CRT\X86\;C:\Users\a904778\Downloads\apache-ant-1.9.16-bin\apache-ant-1.9.16\bin;C:\Users\a904778\Downloads\apache-ant-1.9.16-bin\apache-ant-1.9.16\bin;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Users\a904778\AppData\Local\Microsoft\WindowsApps;C:\Users\a904778\Downloads\gradle-3.0-bin\gradle-3.0\bin;
PS: I even tried to unistall/ install InteliJ but same error.
I checked ALL the forum before and nothing worked.
答案1
得分: 0
以下是翻译好的部分:
"OK actually to fix this I just uninstalled all java installations (even in programfiles/java) and reinstalled intellij/java and it worked."
英文:
OK actually to fix this I just unistalled all java instalations (even in programfiles/java) and re install intellij/java and it worked.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论