-2

I just upgraded IntelliJ IDEA Community edition; but now it cannot find the location of my OpenJDK in order to use it to compile; and it's asking me to point it (the Integrated Development Environment) to it by showing it exactly what folder it is installed on. Yet, I cannot find that folder. I don't know which one it is. Can anyone help me with that, please?

I tried browsing the folders "Program Files," "Program Files (x86)," "Windows" and "Users" for it as well as searching file explorer for it; although nothing came up. Yet, I know it is installed an VS Code uses it to compile Java. I was expecting to find a folder called either "OpenJDK" or "JDK," but did not find either.

I would really appreciate it!

Sincerely,

Nataly

2 Answers2

0

If you don't recall installing a standalone JDK when you installed JetBrains IDEA, it's probably because you didn't actually do so.

From the JetBrains installation guide:

You do not need to install Java to run IntelliJ IDEA because JetBrains Runtime is bundled with the IDE (based on JRE 17). However, to develop Java applications, a standalone JDK is required.

You should double check by examining your PATH environment variable as advised in one of the comments to your question.

  • Open the System Control Panel
  • Click the Advanced Settings link
  • Click Environment Variables
  • Look for a listing for JDK or OpenJDK in the PATH variable

You can install OpenJDK anywhere, but usually you're going to find it someplace like c:\Program Files\OpenJDK\<version>\ where <version> refers to whatever version of JDK you chose to install. Again, because OpenJDK is typically distributed as a ZIP archive, you can literally install it anywhere on your machine, as long as you supply the location of the bin directory to your PATH.

Windows also includes the where utility which you can invoke from the command line to search for files, just in case you did install a JDK at some point and just can't remember where you put it.

If you choose not to use the JetBrains runtime, you can always substitute a separately downloaded and installed version of JDK, or in your case, follow the instructions to point back to the JetBrains runtime.

MarsAtomic
  • 10,436
  • 5
  • 35
  • 56
0

First of all, would you mind looking at Run>Edit Configuration. You should able to locate installed jdk over there. For my case... enter image description here

If you are using msi or exe to install your jdk, you should able to find it in Control Panel\Programs\Programs and Features. Find the version of it and install the installer again from openjdk and if it exist in your computer, it should have the option to remove or repair.

Extra: I don't know which company openjdk you installed. For example, if you use redhat, the default location is C:\Program Files\RedHat\xxx. Also by re-downloading any version of openjdk from the source, you should able to get hints what is the default location of the openjdk.

To make sure you installed your openjdk and configured JAVA_HOME, you can go cmd and type "java --version"

enter image description here

Chan
  • 61
  • 8