TransWikia.com

JDK path in IntelliJ IDEA on Windows 10 Enterprise

Stack Overflow Asked on December 20, 2021

I have the JDK path in IntelliJ IDEA set to C:Program FilesJavajdk8 , nevertheless, when I go to the file system I am not able to find this path, and I show all the hidden files !

enter image description here

I can also access to the folder from the IntelliJ IDEA terminal, but not from the command line:

enter image description here

C:>cd "C:Program FilesJava"
The system cannot find the path specified.

C:>cd C:Program FilesJava
The system cannot find the path specified.

5 Answers

The issue you have is related to the version of Intellij you are running (x86 or x64).

On 32 bit applications the only available directory for program files is the "Program Files (x86)" and is shown for them as "Program Files".

(see https://www.howtogeek.com/129178/why-does-64-bit-windows-need-a-separate-program-files-x86-folder/ ).

If this is the issue, you will be able to find the JDK under: "C:Program Files (x86)Javajdk8"

Answered by Yosef-at-Panaya on December 20, 2021

Set the path by doing the follow

This-PC -> System properties-> advanced system settings -> environment variable

Then add the path to your java bin folder like this C://program files/Java/jdk1.8/bin

Apply/save

Then go back to CMD and type javac or java

Answered by Temidayo Dtuzzy Omotayo on December 20, 2021

The root cause of such a situation is some wrong path set in the PATH environment variable. Let's assume echo %PATH% prints the following:

C:Path X;C:Path Y;D:Path Z;

However, when you go to the environment variables window, you see a longer path. It means that the path after D:Path Z is wrong and therefore the next strings in the PATH variable will throw this error.

To troubleshoot the problem, echo %PATH% and see if it prints your Java path in the output. If not, now you know how to deal with it.

Answered by Arvind Kumar Avinash on December 20, 2021

I would advise you to do the following in your command prompt:

C:Program Files>dir | findstr /I "Java"

You should have something like this (mind the "<DIR>"):

13/11/2019  22:30    <DIR>          Java

It's possible that you have a symlink, junction or something like that, messing up your system. Well, it's not messing up your system, but maybe your application can't handle it. In that case, you might redefine your variable on the directory your symlink or junction is referring to.

Answered by Dominique on December 20, 2021

Restart the IntelliJ IDEA to check whether it's displaying the same in SDK tab.

If it is still showing the same, then, it may be a bug of the software. Generally, it should not show as it's not installed.

Note: Now, as you know that Java 8 is not installed on your system but IDE is showing that it is installed. You can do one thing :

Create a small Java project with sample classes, then try to compile it. If it is not compiling and giving error, then you will be assured that it's not installed.

This will mean that IDE is not updating itself and it's keeping the old record.

Last option, install JDK 1.8 and reinstall Intellij IDEA.

Answered by Anish B. on December 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP