Java 8 on a Mac with SQL Developer 4.1

thatjeffsmith SQL Developer 27 Comments

Tell Others About This Story:

I ran into a few dramas getting SQL Developer 4.1 on my MacBook Air going earlier today.

It boiled down to convincing SQL Developer to find and use the proper JDK on OS X Yosemite.

So just in case it’s not me out there, here’s what I had to do.

Unless you already have Java 8..then skip ahead.

Download and Install a Java 8 JDK

I hate saying ‘Java …JDK’ as the J stands for Java, but until then I guess that’s how I’ll keep saying it. Go here and get the download.

Obviously you want the one that says ‘8’ and ‘OS X.’

Open it.

Double-click on the fancy package icon.

JDK, JDK, JDK - not a JRE!

JDK, JDK, JDK – not a JRE!

If you need more help, here’s the docs around installing Java on a Mac.

To see if it ‘worked,’ run Java from a shell prompt.

java -version

java -version

Download and ‘Install’ SQL Developer 4.1

Get the file.

Once it’s downloaded, open it.

Once it’s expanded, rename it.

Then drag it to your Applications in Finder.

You don't have to do this step, but if you don't, you'll be running SQL Developer out of the downloads folder.

You don’t have to do this step, but if you don’t, you’ll be running SQL Developer out of the downloads folder.

Launch It

Did that work? Great.

No?

I got a warning that SQL Developer was trying to run with Java 7 JDK – the ‘smart’ app code wasn’t finding the Java 8 I had just installed. I could have rebooted my Mac in case the Java path just needed refreshed, but I’m lazy, so I manually told SQL Dev where it could find the JDK.

So on a Mac:

Go into the product.conf file in your $HOME/.sqldeveloper/4.1.0 folder and edit it.

The JDK path on a Mac is drastically different than on Windows. Mind the last Contents and Home subdirectories.

The JDK path on a Mac is drastically different than on Windows. Mind the last Contents and Home subdirectories.

And then you should be cooking with gas.

SQL Developer IS using the Java 8 JDK I just installed

SQL Developer IS using the Java 8 JDK I just installed

Tell Others About This Story:

Comments 27

  1. Hello,
    I’m running SQL Developer 14.1.3.20.78 on Mac OSX El Capitan 10.11.5, Java SDK 1.8.0_92 installed;
    The program works, but extreeeeemely slow, as in “not working”.
    When I click something, the program seems to have problems “drawing” the objects. Most of the stuff on screen isn’t displayed properly.
    Have you encountered anything like this?

    Thank you.

    1. thatjeffsmith Post
      Author
  2. Hi Jeff,

    You may want to add a note that for El Capitan users, they need to disable SIP first before installing Java 8.

    Aside from that, following everything you said on your blog enabled me to run SQL Developer on El Capitan.

    Thanks!

  3. I just installed SQL developer 4.1.3 and JDK 1.8. I use to be able to run SQL developer (Had version 3 something) a while ago. I ran the installer without deleting the older version. I have forgotten it was installed. I did remove all previous versions. I went online to make sure all the files were removed. I believe they were, but not 100% sure. Anyway, I can’t seem to be able to run SQL developer at all. It seems stuck on the loading screen (at about 10%). I am running Mac OS 10.10.5 (Yosemite). I tried attaching a screen shot to the comment, but it won’t attach 🙂 Do you have any insights as to why the installation is stuck?

    1. Never mind. I ended up deleting all the files from previous installs (and the current one as well) and reinstalled the latest version. Also modified the product.conf file to the actual path for the JDK virtual machine and voila! it worked. Thanks

  4. Hi Jeff,
    I have SqlDev 4.1.3 running with JDK 8u72. It opens up but never takes focus, i.e. the finder bar never says Sql Developer. And it won’t let me type anything. The mouse input works but no cursor. I

    I’ve completely uninstalled SqlDev and all of Java but always get the same thing.

    Any ideas?

    Thanks,
    Chris

    1. thatjeffsmith Post
      Author
        1. thatjeffsmith Post
          Author

          Weird…the first and only thing comes to mind is maybe give the JVM some more memory. Take a look at the product.conf file in your $HOME/.sqldeveloper/4.1.0 directory.

          This is assuming you DID NOT take a 4.1.3 SQLDev app and extract it on of an existing SQLDev app on your mac..which you’d have to try REALLY REALLY hard to do – it happens somewhat frequently on Windows and can cause weird things like this.

  5. Hi Jeff,
    Thanks. My system is Linux(ubuntu 15.10),I am having this problem with java 7 and sql developer 4.1,

    [email protected]:~/Programs/opt/sqldeveloper$ ./sqldeveloper.sh
    Oracle SQL Developer
    Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.

    Found /usr/lib/jvm/java-7-oracle/bin/java to run this product, and the major version of this Java is 1.7.
    The mandatory minimum major version to run this product is 1.8.
    This product cannot run with this Java.

    Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/cavadjava/.sqldeveloper/4.1.0/product.conf

    Error: /bin/java not found or not a valid JDK
    Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/cavadjava/.sqldeveloper/4.1.0/product.conf

    1. thatjeffsmith Post
      Author
  6. I had done everything under the sun for downloading 4.1.1. I thought there was no way SQLDev was going to run on my machine but I decided to delete both Java and the SQLDev files I had on my computer and do this tutorial. I followed every line and every link and it worked great! I fixed it by downloading 4.1.0!! Thanks!

  7. The best way to configure java home according with java system configuration in MacOSX is to add

    SetJavaHome `/usr/libexec/java_home -v 1.8`

    in product.conf file
    Best.
    Gianluca

  8. Hi Jeff,
    Thanks. I am having this problem with java 8 and sql developer 4.1. I am not following your last step maybe because I am new to java and SQL.
    I cannot find ; ‘product.conf file in your $HOME/.sqldeveloper/4.1.0 folder and edit it’
    and when I find .conf files under ‘sqldeveloper>contents>resources>sqldeveloper>sqldeveloper>bin’
    none of them are named product.conf and i cant open any of them.

    Id appreciate some help.

    Thanks
    Emma

    1. thatjeffsmith Post
      Author

      No problem Emma.

      You need to open a terminal window.

      Type
      CD

      this will take you to your $HOME directory.

      Under that directory there are several ‘hidden’ directories. You can see them with a ‘ls -a’ command. You’ll see the ‘.sqldeveloper’ folder. In Linux, you ‘hide’ directories by putting a ‘.’ in the name.

      Under that you’ll find the product.conf.

      You may be able to do this using Finder as well.

  9. I didn’t think of rebooting, but when I got to that point in your blog, I thought that I might lazily try that – fail!

    I swear it said I had java 8, but java version didn’t show it.

    I downloaded a second time – obviously I didn’t quite go the same page at oracle – didn’ grab exactly the same file….second time was charmed, now sql developer is running.

  10. Hi how do i get the oracle database on my Mac. I have SQL developer and nit sure how i go ahead from there. I have Yosomite on my Mac.

    1. thatjeffsmith Post
      Author
    1. thatjeffsmith Post
      Author

Leave a Reply

Your email address will not be published. Required fields are marked *