Oracle – for when it was like that when you got there

Main menu

Post navigation

Upgrading to SQLDeveloper 3.0 on Ubuntu

My new year’s resolution that no alcohol will pass my lips is in no way connected to the fact that the only drink left in the house is half a bottle of cooking sherry that I’ve had for ages and really don’t like the look of right now.

As I’ve struggled through the hangover haze of a New Year’s Eve spent being corrupted by my better half, I’ve made a number of discoveries :

I now know why Belgian beer is only served in small glasses

the more you drink, the less it matters about the accuracy of your cocktail mixing skills

Update – if you’ve stumbled across this looking for instructions on how to install SQLDeveloper4, then this may help.

Now, to call it an “Upgrade” is a slight misnomer – you really need to install each version of SQLDeveloper in it’s own right. The only difference is that SQLDeveloper will look for older versions of itself and offer you the chance to import any connections or other modifications that you may have made in those versions.

The system I’m using is Ubuntu 9.10 desktop ( 32-bit) running Oracle XE ( no Oracle client).
I already have a JDK installed.
Having reviewed the Release Notes, I know that this version of SQLDeveloper requires Java JDK version 1.6_11 or higher to run, so the first step is to check out what Java version I’m running and update it if necessary.

The Vexed Question of Java Version Numbers

I don’t know if it’s just me, but don’t you remember a time where a piece of software only had one version number ? This practice seems to have rather fallen out of fashion. Let’s take Java as a completely random example.
Java 6 is actually Java 1.6.
In Oracle’s documentation Java 6 update 11 is Java 1.6_11.
In Synaptic Package Manager it’s Java 6.11_0

Incidentally, it doesn’t matter which of the java packages I used in the update-java-alternatives command, the end result is that the symbolic link pointed to by /usr/bin/java ( /etc/alternatives/java) points to the JRE directory (even in the in the JDK). The upshot is that SQLDeveloper will complain about the lack of a J2SDK when you come to run it for the first time. Honestly, there’s no pleasing some software. I’ll come onto the workaround for this in a bit.

Getting SQLDeveloper 3

OK, let’s trot along to Oracle and download the latest and greatest SQLDeveloper ( 3.0 Early Adopter at the time of writing).

A couple of points to note at this stage.
First – we need the “SQLDeveloper for Other Platforms” and NOT the Linux RPM.
Second – someone at Oracle has obviously had a similar New Year celebration to me as all of the version numbers on the installation instructions are still 2.1.1.64.45.
For the record, the correct version number is 3.0.02.83

Anyway, download the zip file. In my case I’m using Firefox and so the file is downloaded to $HOME/Downloads.

Installing the New Version

My currently installed version of SQLDeveloper is installed under /opt/sqldeveloper. I don’t want to overwrite this at the moment for a number of reasons. Not least of these is that I want to migrate all of my connections, add-ons etc to the new version of SQLDeveloper. Another fairly major consideration is that I want to make sure this all works first.
So, I’m going to create a separate directory under /opt, copy the zip to that directory and then uncompress it.

Ready to run it ? Not so fast. If we run it now, it’ll complain that it can’t find a JDK (as mentioned earlier).
So, we need to add a line to the sqldeveloper.conf in /opt/sqldeveloper3.0.02.83/sqldeveloper/sqldeveloper/bin :

The line we want to add tells sqldeveloper.sh to skip the check for the JDK ( we already know we’ve got an appropriate version) :

SetSkipJ2SDKCheck true

Now, make sure the target database is running and …

$ cd /opt/sqldeveloper3.0.02.83/sqldeveloper
$ sh sqldeveloper.sh

At this point you will get a number of Java errors which seem to be to do with not being able to find the SQLDeveloper data modeller. Not surprising since we haven’t installed it. Fortunately, these errors are not fatal and the tool should start with no problem.
The first thing it will do is pop up this window :

Save yourself some hassle and say Yes

Just say yes and all of your connections and any user defined extensions, reports etc will also be imported.
SQLDeveloper then fires up and all should be OK…but just connect to the database and run a simple query to be sure.

The icon to use is in /opt/sqldeveloper3.0.02.83/sqldeveloper/sqldeveloper/doc.

The final step is to make sure that you have all of the appropriate environment variables set ( which should be the case if you have an existing version of SQLDeveloper) – re-start the machine.
You should be able to run SQLDeveloper from the menu and also, still be able to connect to the database without any issues ( provided the database is up, of course – don’t tell me you’ve been indulging as well !)

If you do happen to hit any issues with a missing ocijdbc11, then have a look here.

Right, that’s quite long enough to keep a New Year’s resolution. I’m off to the pub.