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

一笑奈何 提交于 2019-12-03 23:36:32
Adam Wright

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)
  2. Download and install Java 8. https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  3. Launch SQLDeveloper.

Kris Rice

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

If you check the download page (http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html) it says JDK8 required. I don't think it supports Java 9 or 10. Many programs still don't.

As for the command you tried it is for Windows, there is no c:\Program Files on MacOS. It should be enough to run java -version.

You may want to check how you can run multiple Java versions, see Mac OS X and multiple Java versions. It is a bit messy, but sooner or later you will need it!

user12221647

You have to set the Java home. Please follow the steps given below.

  • find the installation directory by right-clicking the OracledataModeler icon and "Show Package Content" this will show you the installation directory on a Mac

  • Go to the (installation directoy for example ) /Users/user directory/Downloads/OracleDataModeler.app/Contents/Resources/datamodeler/datamodeler/bin

  • edit the datamodeler.conf file in the \datamodeler\datamodeler\bin directory and add SetJavaHome. (e.g. SetJavaHome /usr/lib/jdk18)

  • SetJavaHome /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home

  • Start the SQL data modeler from (installation directory) /Users/user directory/Downloads/OracleDataModeler.app/Contents/Resources/datamodeler/datamodeler.sh

If OpenJDK would work for you, and you are already using/willing to use Homebrew, AdoptOpenJDK works for me:

brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk8

I have not tested this thoroughly, but at the very least I am able to bring up SQL Developer 19.1.0.094, connect to a database, and run queries on it.

It did not work if I tried to use their instructions to install the "latest" version: brew cask install adoptopenjdk, as this seems to install OpenJDK 12.x as of May 2019.

There are other methods to install OpenJDK, but this was an easy one.

I had the same problem, and none of the above solutions worked for me. I am running MacOS 10.14.5

Instead, I had to uninstall Java12 which I had installed via home brew, and sqlDeveloper. After uninstalling and deleting both, I installed Java8 JDK directly from the oracle website via download, and then I reinstalled sqlDeveloper. After wasting three hours trying to get this to work, this set of steps finally did the trick. I hope this helps others.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!