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

Main menu

Post navigation

Installing SQLDeveloper 1.5.5 on Ubuntu 9.10

Continuing my adventures in this strange and (mostly) wonderful new world of Ubuntu…

Now I’ve managed to get Oracle XE to behave itself on Ubuntu, it’s time to install SQLDeveloper.

Note – if you’ve stumbled across this post whilst looking for instructions for installing the latest version of SQLDeveloper ( currently version 4), you can find instructions here.

The aim is to :-

1)Install SQLDeveloper so it’s working ( i.e. can connect to my XE database)
2)Setup a Menu item so I don’t have to mess about running a shell script to start it every time.

So, deep breath…

Checking Installation Requirements for SQLDeveloper

Hang on, wouldn’t the first step be getting SQLDeveloper ? Um, that’s what I thought, but years of Oracle installations have taught me that it’s normally a good idea to have a read through the installation requirements, just in case. I found them here.
A couple of points to note the SQLDeveloper Release Notes :-

The required JDK version

Unlike Windows, SQLDeveloper isn’t supplied with it’s own JDK, which means that you have to make sure the one on your system is compatible with the tool.

That’s easy enough. Just open a terminal session and type :-

java -version

The output I got on my still fairly vanilla Ubuntu installation was :-

The release notes for SQLDeveloper 1.5.5 does say it’ll work with Java 6, but only patch 3 and above. So, looks like I’m going to have to upgrade the Java version.NOTE – at this point it’s worth mentioning that I initially managed to install SQLDeveloper without upgrading the JDK and to get it to start and connect to XE.
This was achieved by adding the following line to sqldev_home/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf :-

SetSkipJ2SDKCheck true

Where sqldev_home is the directory under which you’ve installed SQLDeveloper.
However, that’s all I did – fire it up and connect to the database. I don’t know what bits of the tool don’t work with this JDK version.
So, to be on the safe side I decided to update the JDK.

Updating the JDK

Back into Synaptic Package Manager…
In the Quick Search, type in Java.
The package we’re looking for is sun-java6-jdk
Mark it for download and let Synaptic do it’s thing ( it’ll install about half a dozen related packages).
Once it’s finished, you’ll then need to change the java version that the OS uses by pointing it to the one you’ve just downloaded.
Doing this is comparatively straight forward. The instructions I followed are part of the Ubuntu Documentation at .
Essentially, what you need to do is Open a Terminal session and do the following :-

sudo update-java-alternatives -l

This will give a list of the available java versions on your system.
In my case, the list I got was :-

That error is apparently a bug connected with the Java package supplied by Sun.
The bug number is 226911 on launchpad .
As far as I can tell, it hasn’t broken anything, so I’m not going to worry about it for now.

Getting SQLDeveloper

Trawling through Synaptic Package Manager, you can see that there is something called sqldeveloper-package which is described as “Oracle SQL Developer Debian Package Builder”.
This package is available from the same repository as I added to get XE.
Not sure about this Package Building bit, and after some cursory reading, I decided that I’d rather download direct from the Oracle site.

Click on the download link on the oracle site ( the URL above).
The download option we need is Oracle SQL Developer for other platforms.
Firefox will save the file to /tmp.
Now we need to move it to a suitable location to create the sqldeveloper home.
All in all, /opt looks to be the best place to put this.
Back into Terminal :-

mv /tmp/sqldeveloper.zip /opt/.

So, with sqldeveloper.zip in place :-

unzip sqldeveloper.zip

This will create the sqldeveloper home directory structure.
Finally, we just need to run the following :-

cd /opt/sqldeveloper
sh sqldeveloper.sh

You may get prompted for the location of the JDK. If so, just specify

/usr

The script should then look for

java/bin/java

, find it, realise it’s the correct JDK version, and SQLDeveloper will start.
The first time you run SQLDeveloper, it’ll ask you about importing settings. This is only relevant if you have a previously installed version.

Connecting to the database

First off, you need to make sure that your database is up and running.
In SQLDeveloper Go to the File menu and Select New
Select Connections from the tree in the left hand pane and then Database Connection in the right hand pane.
Enter the following in the New/Select Database Connection dialog :-Connection Name– the name of the connection that you want to appear in the SQLDeveloper Connections list.Username and Password should be the credentials for the database user you want to connect as
(Note – if you click the Save Password checkbox, SQLDeveloper will remember it, otherwise you’ll be prompted for it each time you use this connection).Role – leave this as Default for nowConnection Type – change this to TNS.
If XE ( and more to the point, the TNS listener) is up, then the display will change to show a drop-down list called Network Alias, containing all of the entries in the tnsnames.ora file.
Select XE
Click the Test button to make sure that you’ve input the correct information and you should get a success message.
Click Save and the connection should now appear under the Connections node in the main SQLDeveloper tree.

UpdateI subsequently had a problem with the TNS connection. See here for a workaround.

Adding a Menu Option for SQLDeveloper

I don’t really fancy running the shell script manually every time I want to run SQLDeveloper, so I’d like to add it as a menu item.
To do this, we need to change the permissions on the script first :-

sudo chmod 755 sqldeveloper.sh

This will allow you to execute the file as your normal user from the menu.
Adding the menu item itself is something you can do easily through the Ubuntu desktop :-

Go to the System menu and select Preferences then Main Menu.
I chose to put SQLDeveloper on the Programming Menu ( click the appropriate menu in the left-hand pane).

Click on New Item

In the dialog, enter the following :-Type is ApplicationName – SQLDeveloper 1.5.5Command is /opt/sqldeveloper/sqldeveloper.sh

You should then be asked to specify an icon. There are two icon files in /opt/sqldeveloper, pick whichever you fancy ( they’re both the same)

Once you Close the Main Menu window, you should be able to see the new menu Item for SQLDeveloper under the Applications/Programming Menu.
Click on it, and it should start SQLDeveloper.
And the adventure continues !

I was planning to write an updated version – probably on Ubuntu 10.04 – when SQLDeveloper 3.0 comes out.
Oracle are notoriously tight-lipped about release dates but it seems likely that it’ll be out anytime now, ready for OpenWorld.