cozimo
cozimo

Reputation: 115

Intellij can't find JDK

I couldn't find any other answers on StackOverflow on this. I just installed Intellij, and it can't find my JDK for some reason.

Here's what I did:

Install Java JDK 9.0.1

  1. Open Intellij
  2. Open new project
  3. Clicked "new" button beside the find SDK.
  4. Found my java 9.0.1 bin folder under Program Files. It didn't work.
  5. Tried java 8.something folder under Program Files (86x). It didn't work.
  6. Went into advanced system settings and edited the path variable to the new java 9.0.1 bin as per (https://classroom.udacity.com/courses/ud282/lessons/8186340458/concepts/900a2a40-3921-4604-a258-c11ec355003c).
  7. Now I can't even open Intellij. It just says: Cannot start under Java 1.7.0_79-b15: Java 1.8 or later is required.

Note: I also have Android studio and Netbean and both have been working no problem. Heard Intellij was better than Netbean so tried using it for the first time.

Upvotes: 5

Views: 30739

Answers (3)

Richard Collette
Richard Collette

Reputation: 5703

I experienced this error after adding a .sdkmanrc file to a project with

java=21.0.3-tem

It kept saying it couldn't find the SDK during the build even though it was visible in the project/module settings. Invalidating cache did not help.

I had to export my settings, open the project, then import my settings and restart and everything is good.

I lost my most recently used project on the home screen in the process but not the end of the world.

The thought came to me after reading this support article

Upvotes: 1

harold garcia
harold garcia

Reputation: 1

my solution was to reinstall and the path has already been received:

sudo apt-get install openjdk-8-jdk

the path that I put after was:

/usr/lib/jvm/

Upvotes: -2

Ravik
Ravik

Reputation: 734

you do not need to select the bin folder just select the path where Java is installed. Go to project structure (ctrl+alt+shift+s) and add new sdk refer to below pic for details. enter image description here

Upvotes: 11

Related Questions