SQLDeveloper on macOS Monterey

If you’ve upgraded to macOS Monterey and try to use Oracle SQL Developer you may experience an issue that it starts and then closes after a few minutes. After some research I found that it’s a Java 11 issue with the latest version of macOS.

With the help of a few people on Twitter and Vito Campanelli I was able to get it working by doing the following steps:

Upgrade / Install Java 17

I got the following instructions from this blog post.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Download file
# Can download from https://jdk.java.net/17/ or use curl (below)
curl -O https://download.java.net/java/GA/jdk17.0.1/2a2082e5a09d4267845be086888add4f/12/GPL/openjdk-17.0.1_macos-x64_bin.tar.gz

# Uncompress and "install" java17
sudo mv openjdk-17.0.1_macos-x64_bin.tar.gz /Library/Java/JavaVirtualMachines/
cd /Library/Java/JavaVirtualMachines/
sudo tar -xzf openjdk-17.0.1_macos-x64_bin.tar.gz
sudo rm openjdk-17.0.1_macos-x64_bin.tar.gz

# Register Java17 home:
/usr/libexec/java_home -v17 /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home

# Can verify that it's in your JavaHome by running: (optional)
/usr/libexec/java_home -V

Define SetJavaHome in SQL Developer configuration

1
2
3
4
5
6
7
8
9
10
11
cd ~/.sqldeveloper/

# List your versions of SQL Developer
ls

# Find the most recent one (mine is 21.2.1) and open that directory
cd 21.2.1

# Add the following to the file:
# Can manually open file and edit or just run below and it'll add it to the bottom of the file
echo "SetJavaHome /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home" >> product.conf

Start SQL Developer

When you start SQL Deeveloper a new warning message will appear that states You are attempting to run with Java 17.0.1 ... (screenshot below). Click Yes to accept and continue.

Summary

I’ve only tried this for a day now and everything seems to be stable. That said there’s a warning message for a reason and I and hope there’s a Java 11 update soon that resolves the issue.