Deb recently bought a new kettle.
Now, a kettle used to simply boil water and turn itself off when it was done.
Not this thing.
It lights up as it boils and announces the fact that it’s finished with a melodious ping.
It’s got gauges and lights and switches.
I’ve decided that it’s probably a Dalek in disguise.
Like Daleks (or at least, the original Daleks), it can’t go up stairs – or if it can, it’s not advertising the fact.
Every morning, descending to the kitchen is filled with trepidation.
When will the Dalek tire of vaporizing innocent water molecules and move on to World Domination…
I wouldn’t be entirely surprised to find that, like most whizzy modern appliances, it runs on Java.
Which brings us, by a fairly circuitous route, to the topic at hand – SQLDeveloper.
Oracle’s latest incarnation of it’s IDE does indeed run on Java – the version 7 JDK to be precise.
In this post, I’ll go through the steps required on Mint to :
- Install the Java 7 JDK
- Install SQLDeveloper 4
- Persuade SQLDeveloper 4 to play nicely with Java
- Add SQLDeveloper to the Cinnamon Menu
The good news is that we can do all of this without the messy alien conversion of an rpm package to .deb format.
NOTE – I’ve followed these steps on Mint13, but they should be pretty much the same for any Debian Distro.
Anyway, without further ado…
Install Java 7
What’s installed now
Before getting into the installation, it’s probably a good idea to establish what Java version you have at present.
To do this, open a Terminal Window and :
java -version
This will probably return something like :
java version "1.6.0_30" OpenJDK Runtime Environment (IcedTea6 1.13.1) (6b30-1.13.1-1ubuntu2~0.12.04.1) OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
Assuming you haven’t got a version that is 1.7.0 or greater, you’re going to need to update it for SQLDeveloper.
Getting the latest and greatest Java version
The easiest way to do this is – courtesy of instructions found here :
sudo add-apt-repository ppa:webupd8team/java
Running this will give you a message similar to the following :
You are about to add the following PPA to your system: Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK6 / JDK7 / JDK8). There are no actual Java files in this PPA. More info: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html Debian installation instructions: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html More info: https://launchpad.net/~webupd8team/+archive/java Press [ENTER] to continue or ctrl-c to cancel adding it
Hit ENTER and…
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.HQYZnMcKX0 --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80/ --recv 7B2C3B0889BF5709A105D03AC2518248EEA14886 gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com gpg: key EEA14886: public key "Launchpad VLC" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1)
I’m not sure if the following step is necessary, but I ran it to be on the safe side. Ensure that your packages are up-to-date by running :
sudo apt-get update
Now for the installation itself…
Installing Java 7
Start by getting the installer :
sudo apt-get install oracle-java7-installer
The output looks like this :
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: gsfonts-x11 Suggested packages: visualvm ttf-baekmuk ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming The following NEW packages will be installed gsfonts-x11 oracle-java7-installer 0 to upgrade, 2 to newly install, 0 to remove and 31 not to upgrade. Need to get 26.7 kB of archives. After this operation, 228 kB of additional disk space will be used. Do you want to continue [Y/n]?
Yes, we do want to continue so enter ‘Y’.
At this point you’ll be presented with the following screen :
Hit ENTER and …
Use the left arrow key to navigate to Yes and hit ENTER.
You will then get feedback to the effect that it’s downloading stuff. This should end with something like :
Oracle JDK 7 installed update-alternatives: using /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/mozilla/plugins/libjavaplugin.so (mozilla-javaplugin.so) in auto mode. Oracle JRE 7 browser plugin installed Setting up gsfonts-x11 (0.22) ...
To check that it’s done what we wanted :
java -version java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
Where’s the JDK ?
At this point, the system is using the java executable from the Java Runtime Environment (JRE).
SQLDeveloper will need to know where the Java Developer Kit (JDK) is located.
You can verify this and find the JDK itself as follows :
which java /usr/bin/java
If you look at /usr/bin/java you’ll see it’s a symbolic link…which points to another symbolic link…which eventually points to the actual location of the java executable…
ls -l /usr/bin/java /usr/bin/java -> /etc/alternatives/java ls -l /etc/alternatives/java /etc/alternatvies/java -> /usr/lib/jvm/java-7-orale/jre/bin/java
In this case, the Java executable is in the JRE, not the JDK.
Fortunately, the JDK itself is also present. We can find this in :
/usr/lib/jvm/java-7-oracle/bin
We need to keep a note of that directory for when we fire up SQLDeveloper.
Speaking of which…
Getting the right SQLDeveloper
To get the SQLDeveloper download, you will need an Oracle Technet account. Fortunately, this is free.
You can do this by going to the Technet Home Page.
Once you’re set up, go to the SQLDeveloper Downloads Page.
There are a couple of things to note here.
First, the package you need to download is labelled Other Platforms.
Secondly, if you do happen to look at the Release instructions for this package, it will mention JDK 1.6.0_11 or above.
These instructions are out of date in this regard and refer to the previous version of SQLDeveloper.
Anyway, on the download page, click accept License Agreement and click on the Other Platforms Download.
At this point, you may be asked to re-enter your Technet credentials.
When prompted by Mint, save the file.
Once completed, go to the Downloads directory and you should see…
cd $HOME/Downloads ls sqldeveloper-4.0.1.14.48-no-jre.zip sqldeveloper-4.0.1.14.48-no-jre.zip
Installing SQLDeveloper4
We’re going to install SQLDeveloper under /opt so…
sudo mkdir /opt/sqldeveloper401
Now to copy and extract the zip file …
sudo cp $HOME/Downloads/sqldeveloper-4.0.1.14.48-no-jre.zip /opt/sqldeveloper401/. cd /opt/sqldeveloper401 sudo unzip sqldeveloper-4.0.1.14.48-no-jre.zip
At this point, the output will look something like this :
... inflating: sqldeveloper/svnkit/licenses/COPYING inflating: sqldeveloper/svnkit/licenses/JAVAHL-LICENSE inflating: sqldeveloper/svnkit/licenses/SEQUENCE-LICENSE inflating: sqldeveloper/svnkit/licenses/SQLJET-LICENSE inflating: sqldeveloper/svnkit/licenses/TRILEAD-LICENSE inflating: sqldeveloper/svnkit/licenses/license.txt inflating: sqldeveloper/svnkit/sequence.jar inflating: sqldeveloper/svnkit/sqljet.jar inflating: sqldeveloper/svnkit/svnClientAdapter.jar inflating: sqldeveloper/svnkit/svnjavahl.jar inflating: sqldeveloper/svnkit/svnkit.jar inflating: sqldeveloper/svnkit/trilead.jar inflating: sqldeveloper/view-source-paths.lis
Once completed, we’re now ready to finalise the configuration.
Setting the Java Path for SQLDeveloper
To do this, we simply need to run SQLDeveloper. The first time it starts, it will ask for a path to the JDK.
This will be the path we figured out earlier. So…
cd /opt/sqldeveloper401/sqldeveloper sudo chmod a+x sqldeveloper.sh . ./sqldeveloper.sh
When we execute the shell script to start SQLDeveloper we’ll get…
Oracle SQL Developer Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/mike/.sqldeveloper/4.0.0/product.conf
At this point, we enter the path, minus the bin directory (which SQLDeveloper will look in automatically) :
/usr/lib/jvm/java-7-oracle
If you have a previous version of SQLDeveloper installed, you will be asked if you want to copy all the settings, connections etc to the latest version :
Finally, SQLDeveloper will start.
Adding SQLDeveloper4 to the Cinnamon Menu
To add SQLDeveloper to the menu…
Right-click the Menu in the bottom left corner of the screen and select Configure :
Click the Open the menu editor button.
Select New Item
Name : SQLDeveloper4.0.1
Command : /opt/sqldeveloper4/sqldeveloper/sqldeveloper.sh
Click on the rocket icon and select the sqldeveloper icon at :
/opt/sqldeveloper4/sqldeveloper
Now you should see the SQLDeveloper4.0.1 option under the Programming Menu.
After all that, I feel like a cup of coffee. Now where did I leave that Sonic Screwdriver…
Thank you very much indeed!
LikeLike
Thanks for the great instructions. Everything worked fine until the end when I tried to run ./sqldeveloper.sh. It would error everytime. I found a solution here:
http://ivanbabanin.blogspot.cz/2014/02/sqldeveloper-4-crash-jvm-on-startup.html
I’m not sure why this is needed but it works.
LikeLike
Near the end when I type sudo chmod+x sqldeveloper.sh I get the error: sudo: chmod+x: command not found. I double checked and I am located in cd /opt/sqldeveloper401/sqldeveloper like the previous line says.
Any suggestions would come in handy?
LikeLike
Milos,
my apologies. It’s a typo on my part. The command should read :
I’ve now corrected this in the post.
Mike
LikeLike
Thank you very much, it all works now. Can you please point me to another link where I can set up a new connection. Im not sure what the username and pass should be. I never really used this out of classes where they gave us all this info in advance.
LikeLike
the network adapter could not establish the connection
Am I missing something here? I followed your post line by line. I dont know what the username and pasword is (i tried my linux root) but I keep getting that error when I test. I tried orcl and xe for sid.
LikeLike
Milos,
I assume that you are trying to connect to an Oracle XE database that is installed on the same machine that you’ve just installed SQLDeveloper. Is this correct ?
If so, then there are two users that will definitely exist : SYS and SYSTEM.
You will have been asked to setup passwords for these users when you installed XE.
In these circumstances, you should be able to connect as SYSTEM with the password that you setup when installing XE.
The database name will be XE.
Using the Basic connection setting in SQLDeveloper the settings you need for this connection should be as follows (assuming you used the default port when setting up XE (i.e. 1521):
Connection Name : system_on_xe
Username : system
Password : [whatever password you set for system when installing xe]
Connection Type : Basic Role : default
Host Name : localhost
Port : 1521
SID : XE
If this isn’t working, you could try to specify your machine name as the Host Name.
HTH,
Mike
LikeLike
That was it, thank you
LikeLike
You deserve a big thanks for the complete explanation of:
Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/bogdan/.sqldeveloper/4.0.0/product.conf
/usr/lib/jvm/java-7-openjdk-amd64
LikeLike
Very nice write up. Saved me a ton of time during my work system rebuild from Ubuntu 12 to 14
LikeLike
I’m using linux mint 17.1 MATE and I got it to run however I dont know how to add it to my menu there is no menu button on the bottom right on mate.
LikeLike
David,
I don’t use Mate myself, but this post on Stack Overflow might help.
Looking at that post, it seems that Mate menu setup may be similar to that used in XFCE. If so, then this post might also be worth a look.
HTH
Mike
LikeLike
Nice, but how can i uninstall SQLDeveloper?
LikeLike
Sergey,
seeing as SQLDeveloper itself is installed via the zip ( in this method at least), rather than via a package manager, then you should be able to uninstall simply by deleting the files in the appropriate directory.
I should say I haven’t tried this myself, but I don’t think there’s much more to it than that.
HTH
Mike
LikeLike
This is avery good manual. All doubts are anticipated and all instructions work exactly as stated. If the version of java and the version of Sql Developer is different from those in the instructions, then it is very easy to infer the substitutions. I can tell you that these instructions still hold for the jvm v8 and sqldeveloper version 413 as of today’s date.
LikeLike
Paul,
thanks for the feedback. Good to know that this is still valid for the current version.
Mike
LikeLike