I’ve installed Ubuntu to my laptop (another try to live with Linux), and now trying to organize useful stuff. I wanted to install Oracle SQL Developer and couldn’t find an up-to-date document about it, so decided to write one (which will be use most straight forward steps).
First we download Oracle SQL Developer from Oracle website. You know Ubuntu uses Debian’s package manager: APT. So we should download the zip file (distributed for “Other Platforms”) instead of RPM file.
After the download completed, just extract it to a directory. Your home directory would be fine. To extract, you can use the archive manager (integrated to file manager): after moving the file to your home directory, right click over the file and select extract. Or you can just use “unzip” command.
You should see a new directory called “sqldeveloper”. When you enter into the directory, you’ll see a file named “sqldeveloper.sh”. Although the sqldeveloper.exe file looks like the right one (with its shiny icon), we’ll use the “shell” script version
Right click on the file name, select “properties” and make it executable or you can just use “chmod +x sqldeveloper.sh” on terminal. If you do not have JDK (java development kit) installed on your system (most users just have JRE/java runtime environment), install jdk:
gokhan@exodus:~$ sudo apt-get install openjdk-6-jdk
Then go to jvm folder and check if jdk is installed successfully and learn the exact path of jdk:
gokhan@exodus:~$ cd /usr/lib/jvm gokhan@exodus:/usr/lib/jvm$ ls java-1.6.0-openjdk-amd64 java-6-openjdk-common java-6-openjdk-amd64 java-7-openjdk-amd64
Somehow I have also java-7, but I’ll use java 6 because Oracle SQL Developer is compatible with java 6. So the jdk path will be “/usr/lib/jvm/java-6-openjdk-amd64″.
You probably prefer to run Oracle SQL Developer by clicking on its icon, so I’ll create a desktop icon for it. It’s easier to do it using terminal. Open terminal and run the vi editor:
gokhan@exodus:~$ cd /home/gokhan/sqldeveloper gokhan@exodus:~/sqldeveloper$ vi sqldeveloper.desktop
Enter the following lines (do not forget to fix the paths – I marked them on the below script):
#!/usr/bin/env xdg-open [Desktop Entry] Name=Oracle SQL Developer Exec=/home/gokhan/sqldeveloper/sqldeveloper.sh Terminal=true Icon=/home/gokhan/sqldeveloper/icon.png Type=Application Categories=IDE;Development
Save it (:wq) and then it’s ready to run?! Well, not yet! Because Oracle SQL Developer will ask us to enter the correct path of the jdk. It will ask it twice. On first run, it won’t be able to find a directory to store the jdk settings. Although it’ll create that directory, you need to re-run the SQL Developer and enter the path of jdk again, then it’ll save the settings successfully. Probably this is just a bug and will be fixed on future versions. After SQL Developer stops asking the java path, you may modify the desktop file and remove the terminal=true line. So it will not open a terminal window whenever you click it. I prefer to keep it so I can also see the error/alert messages produced by Oracle SQL Developer.