Setting Amazon Corretto 11 as Project SDK

Answered

I have installed Amazon Corretto as my JDK and am trying to set this as IntelliJ's Project SDK. Selecting "New" --> "JDK" takes me to the "Home" directory of "amazon-corretto-11.jdk". This should be the directory I need, but I get an error saying "Select Home Directory for JDK: The selected directory is not a valid home for JDK". 

 

I've tried selecting multiple directories including "Home", "amazon-corretto-11.jdk", "Contents", and "lib". All selected folders gave me the same error. How do I select the Amazon Corretto SDK?

0
8 comments
Avatar
Permanently deleted user

I just tried to add Amazon Corretto 11 in Ultimate 2019.2 and it worked fine for me. The steps I used was

  1. Installed the macOS x64 *.pkg file to the default location ( /Library/Java/JavaVirtualMachines )
  2. In IntelliJ when adding a JDK I selected the /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk package

IntelliJ located the actual "home" in the JDK and it is now set to "/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home"

Did you install the Amazon Corretto using the pkg or tar.gz file?

0

Make sure you have up to date IntelliJ IDEA version.

0
Avatar
Permanently deleted user

I'm using the community version of IntelliJ. When installing Corretto I did install the pkg file and not the tar.gz file for macOS x64. When I click "New.." to select an SDK, it does automatically choose the "Home" directory for Corretto, but still gives this error. Here are some additional things I've tried, but still getting the same error:

 

- Tried uninstalling and reinstalling Amazon Corretto 11

- Tried updating IntelliJ

0

What's the output from `java -version` for the binary located in the bin subdirectory of this JDK?

Does specifying "amazon-corretto-11.jdk" as the SDK home show the same error?

0
Avatar
Permanently deleted user

Yes, specifying amazon-corretto-11.jdk as the SDK gives the same error.

Here's the output from entering `java -version` in the Terminal:

openjdk version "11.0.4" 2019-07-16 LTS

OpenJDK Runtime Environment Corretto-11.0.4.11.1 (build 11.0.4+11-LTS)

OpenJDK 64-Bit Server VM Corretto-11.0.4.11.1 (build 11.0.4+11-LTS, mixed mode)

 

 

0
Avatar
Permanently deleted user

Any update on this ?
I am facing the similar issue. Is someone able to find any work around for this ? I tried deploying the same code as an ecs-service and it ran fine but I am not sure how can we use corretto while we are doing development.

0

Do you specify "/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home" as the JDK home location? Do you use IntelliJ IDEA 2019.2?

Get the list of files in this JDK location using "ls -laR /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home > jdk-files.txt" and upload the jdk-files.txt file at https://uploads.services.jetbrains.com/.

Provide the output of "/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/bin/java -version" command.

0
Avatar
Permanently deleted user

I'm not sure this is related but there seems to be some kind of problem related to MacOS 10.15 https://youtrack.jetbrains.com/issue/IDEA-220198

If it is the file dialog in 10.15 that is causing the problem there's a workaround mentioned here https://youtrack.jetbrains.com/issue/JBR-1721

/Pontus

0

Please sign in to leave a comment.