Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle SQLDeveloper on MacOS won't open after installation of correct Java

I downloaded the Oracle SQLDeveloper, but when I opened it, it said that it requires a minimum of Java 8 and gave me the website for the download. I went on and downloaded Java 10.0.1, but when I went back on to open SQL, it continued saying it required a minimum of Java 8.

I checked that the Java 10.0.1 had installed correctly, and I'm pretty sure it has. It shows up in System Preferences and when clicked, it opens the Java Control Panel fine.

I'm on a MacOS X El Captain 10.11.6.

like image 533
R.L Avatar asked Jun 05 '18 20:06

R.L


People also ask

Why Oracle SQL Developer is not opening?

This is one of the common issue which most of us face right after the SQL Developer is installed on widows machine. The pre-requisite is to install JAVA SDK and give the path up-to bin directory which contains the java.exe file.

Which Java version is required for SQL Developer?

SQL Developer requires that the Java JDK 1.6. 0_11 or later (but not 1.7. n) be installed on the system, or that you install a SQL Developer for Windows kit that includes a JDK. If you need to install a JDK, go to http://www.oracle.com/technetwork/java/javase/downloads/ .


4 Answers

The post above is right: SQLDeveloper only runs under Java 8.

This is counter-intuitive as other programs runs under at least X version of a software (not only X version). I kept downloading Java 11 with no luck.

After 1 failed attempt a month ago and two hours of searching today, I found this easy fix worked for me.

Solution

  1. Delete the following Java files and folders on your mac.
  • /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
  • /Library/Java/JavaVirtualMachines/(delete current java folder)

1.1 Remove the plugin: sudo rm -rf "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/" Alternatively, If sudo rm -rf makes you as uncomfortable as it should you can also: "Go to the folder" with (Command + Shift = G) and move it to the trash.

  1. Download and install Java 8. https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  2. Launch SQLDeveloper.

like image 113
Adam Avatar answered Oct 16 '22 16:10

Adam


Working solution for Mac running macOS Catalina 10.12.5 with openjdk 11 and SQLDeveloper 19.4.0.354:

Edit /Applications/SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh:

  1. Delete all the code before export JAVA_HOME=$TMP_PATH
  2. Change export JAVA_HOME=$TMP_PATH to export JAVA_HOME=<path_to_jdk>/jdk-11.jdk/Contents/Home
  3. Start SQLDeveloper

If macOS complains about the files being downloaded from the internet call xattr -d com.apple.quarantine <filename>.

Incidentally I saw /Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/bin/jdk.conf has instructions for setting the java home by uncommenting and specifying SetJavaHome but that didn't work for me.

like image 20
Robert Bain Avatar answered Oct 16 '22 17:10

Robert Bain


For Mac users with Big Sur. (I am on 11.2.2):

Edit the following file:

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

and add the path for java 8 as follows:

SetJavaHome /Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home
like image 6
hsuk Avatar answered Oct 16 '22 15:10

hsuk


SQL Developer runs this which checks for java 9 then 8. We don't yet support (lack of a ton of testing) java 10. You went to new for us. Back up to 8 or 9 and should be fine.

We use /usr/libexec/java_home which allows us to specify which version of java we'd like to run. So even if you have N javas installed, it should return the highest one that was passed in with flags.

   #!/bin/bash 
              ##### THIS IS CHECKING FOR JAVA 9 #####
   TMP_PATH=`/usr/libexec/java_home -F -v 9`

   if [ -z "$TMP_PATH" ] ; then

              ##### THIS IS CHECKING FOR JAVA 8 #####
     TMP_PATH=`/usr/libexec/java_home -F -v 1.8`

     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
like image 5
Kris Rice Avatar answered Oct 16 '22 15:10

Kris Rice