One of the great benefits to having an application developed on the Java platform is the ability to run it on many different operating systems. While Windows may still be the corporate standard in more shops than not, geeks worldwide know that Apple’s hardware and OS (OS X) are ‘superior.’ With yesterday’s release of Mountain Lion (10.8) I figured this was a good time to do a quick write-up on how to get started with SQL Developer on your [i]Mac[Book|Mini].
But wait, where is the Java?
The Java runtime that had been included with the OS X installs is no longer available in Mountain Lion. As I understand it, even if you had installed your own version of Java, when you upgrade or install 10.8, they will go away.
So if you try to run a previously installed version of SQL Developer, you won’t get very far. Java applications don’t run very well sans Java, tsk, tsk.
So for the n00bs out there (including me), here’s your
Step-By-Step Guide for Installing Java and SQL Developer
Let’s install Java first.
Getting to the download page is your first task. I’ll make it easy for you.
Java SE Development Kit 7 Downloads
* Yes, I know we officially support 1.6 and not 1.7, but here’s a secret: 1.7 works just fine in version 3.2.20_09 of SQL Developer!
Once it’s downloaded, double-click it.
But wait! Oh no!
Open your preferences, go to the security panel, and select the unsigned software option
Now, we’re cooking with gas! Try double-clicking the download again.
It should go without a hitch. If it does, you’ll see something like this:
Make sure the ‘right’ java is setup and working.
Open a terminal, and run
[text]
java -version
[/text]
If you see ANYTHING but the following…
…you may have a problem.
But this is Apple and OS X, and so it will find Java just fine.
Ok, now we can worry about downloading and installing SQL Developer.
Go here and download ‘Oracle SQL Developer for Mac OSX platforms.
Once it’s downloaded, you’ll need to extract it and run it.
Wait a second…
You know it’s going to ‘work’ if you see the splash screen 🙂
But My SQL Developer is Using the Wrong JDK!?
SQL Developer will use whatever Java it can find. If you have the 1.6JDK installed as well, it might find that first. If you want to force it to use the 1.7 you just installed, all you need to do is explore the SQL Developer package, and edit the sqldeveloper-Darwin.conf file in the bin directory.
You may have noticed that Java 1.6 installs to a different directory than 1.7 on OS X.
- 1.6 – /System/Library/java/JavaVirtualMachines/1.6.0.jdk/Contents/home/
- 1.7 – /Library/java/javaVirtualMachines/1.7.0.jdk/Contents/Home/
Just update the ‘SetJavaHome’ entry to the version of Java you want SQL Developer to use when it runs.
A Few More Notes
You might be wondering why I installed Java 1.7 when we technically only support 1.6. Well, 1.7 will work, and that’s what many of our developer use internally. If you don’t like bleeding edge, feel free to follow the exact same instructions and grab JDK 6 instead.
This is one of the first work related blogs I’ve written on my home machine a la Mac. I didn’t have my trusted Windows friend SnagIt at hand, but @brentO turned me onto a free and very handy utility called ‘Skitch.’ It works, and once you forget all the normal Windows application ‘way of doing things,’ is also very intuitive. And it’s free, did I mention that? Thanks Brent!
If you don’t like that the application title has an underscore in it, e.g. ‘SQL_Developer,’ then here’s a nice post from @martinpaulnash explaining how to fix that too.
74 Comments
I have been downloading Virtual Box and the VM backages .Also the sqlDevelper but when I open the sql Developer and trying to test the connection this error message appears
ora-12514: tns:listener does not currently know of service requested in connect descriptor
on macbook
Which service are you trying to connect to?
Does this include hr and scott schema ? Or do I have to download it separately?
SQL Developer doesn’t include ANY data.
Hi Jeff,
I have a small issue with SQL Developer installed on OS X. When I try to set a DB as default an error message is returned:
incorrect syntax near ‘-‘ Vendor code: 102. I manage to figure out that this issue is caused by the DB name format which is like DDD_123-234 (I can not rename the DB because is a production one and this should involve a lot of work)
Message log is looking like this:
Error starting at line: 1 in command –
/*sqldev:stmt*/USE DDD_123-234
Error report –
SQL error: database ‘DDD_123’ does not exist
Is there any place where I can redefine the command set default database to look like this for good: /*sqldev:stmt*/USE [DDD_123-234]? Or a set up option in which the SQL Developer is not checking DB schema name for “special characters”?
PS: SQL Developer version is 4.1.3.20, JDK 8 Update 74 and JTdS driver 3.1
Best regards,
Catalin