Wednesday, April 15, 2020

SQL Developer on Mac

I'm doing a little Autonomous Database project so I downloaded SQL Developer for Mac. When I run it I get the error:

SQL Developer requires a minimum of Java 8.
Java 8 can be downloaded from:
 http://www.oracle.com/technetwork/java/javase/downloads/

Fortunately this is really easy to fix. I will file a bug so you don't have to make these changes but here's how to fix it.

1. Right click on SQL Developer in the dock and choose Options | Show in Finder
2. Right click on SQLDeveloper.app and choose "Show Package Contents"
3. Double click on Contents and then MacOS
4. Go to http://www.oracle.com/technetwork/java/javase/downloads/ and download JDK 1.8 JRE
5. Unzip it and copy the directory into the MacOS directory
6. Open sqldeveloper.sh in any text editor. I commented out everything in the file and pasted in the following:

export PATH=/Applications/SQLDeveloper.app/Contents/MacOS/jre1.8.0_251.jre/Contents/Home/bin:$PATH
export JAVA_HOME=/Applications/SQLDeveloper.app/Contents/MacOS/jre1.8.0_251.jre/Contents/Home

/Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/bin/sqldeveloper

so now sqldeveloper.sh looks like this:

#!/bin/bash

# TMP_PATH=`/usr/libexec/java_home -F -v 1.8`
# if [ -z "$TMP_PATH" ] ; then
#   TMP_PATH=`/usr/libexec/java_home -F -v 9`
#   #TMP_PATH='/Applications/SQLDeveloper.app/Contents/MacOS/jre-9.0.4.jre/Contents/Home'
#   if [ -z "$TMP_PATH" ] ; then
#     osascript -e 'tell app "System Events" to display dialog "SQL Developer requires a minimum of Java 8. \nJava 8 can be downloaded from:\n http://www.oracle.com/technetwork/java/javase/downloads/"'
#     exit 1
#   fi
# fi
#
# export JAVA_HOME=$TMP_PATH
#
# if [[ -f $HOME/.sqldeveloper/19.1.0/env.sh ]];
# then
#   source "$HOME/.sqldeveloper/19.1.0/env.sh" >> /dev/null
# elif [[ -f $HOME/.sqldeveloper/env.sh ]];
# then
# source "$HOME/.sqldeveloper/env.sh"  >> /dev/null
# fi
#
#
# here="${0%/*}"
# cd "${here}"
# cd ../Resources/sqldeveloper/sqldeveloper/bin
# bash ./sqldeveloper >>/dev/null


export PATH=/Applications/SQLDeveloper.app/Contents/MacOS/jre1.8.0_251.jre/Contents/Home/bin:$PATH
export JAVA_HOME=/Applications/SQLDeveloper.app/Contents/MacOS/jre1.8.0_251.jre/Contents/Home

/Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/bin/sqldeveloper

7. Save sqldeveloper.sh

Now run it and you should get the splash screen.



I actually worked on the core product that SQL Developer uses and built that splash screen, the fancy progress bar graphics and all the loading code of the plugins and migration system.

1 comment:

Unknown said...

thanks man ! it really solved my issue and saved my time. :)

Post a Comment