DEV Community

loading...

How to Install Oracle SQL Developer on Ubuntu 20.04

ishakantony profile image Ishak Antony Darmawan ・4 min read

This is a fairly straightforward guide to install Oracle SQL Developer on Ubuntu 20.04

Gathering Files

Prerequisite

  • Oracle JDK 8/11
  • Oracle SQL Developer

Downloading Prerequisite

Oracle JDK 8/11

  1. Go to download Oracle JDK page
  2. I will use Oracle JDK 11 because it has a .deb installation file which can be easily installed using dpkg Oracle JDK Download Page
  3. Download Oracle JDK 11 for Debian package (at the time of this post, the version is 11.0.8), you will be prompted to sign in using oracle account to download Oracle JDK 11 Download Page

Oracle SQL Developer

  1. Go to download Oracle SQL Developer page
  2. Download Oracle SQL Developer for Other Platforms (at the time of this post, the version is 20.2) Oracle SQL Developer Download Page

Prerequisite Completed

Prerequisite Completed

Installation

Install Oracle JDK 11 and Oracle SQL Developer

Oracle JDK 11

  1. Open your terminal, go to directory where your prerequisite files are located (in my case it's in ~/Downloads) Files
  2. Install Oracle JDK 11 by using command sudo dpkg -i [YOUR_ORACLE_JDK_PACKAGE.deb], in my case it's sudo dpkg -i jdk-11.0.8_linux-x64_bin.deb Install Oracle JDK 11
  3. Verify your installation by listing the directory of /usr/lib/jvm Verify Oracle JDK 11

Oracle SQL Developer 20.2

  1. Open your terminal, go to /opt directory. This is where i will store the sqldeveloper application, you can choose other directory, but this my preference (and i read also that /opt is for 3rd party apps that we cannot install via apt package manager) Go To opt
  2. Unzip Oracle SQL Developer with command sudo unzip [YOUR_SQL_DEVELOPER_FILE_WITH_LOCATION].zip, in my case it's sudo unzip ~/Downloads/sqldeveloper-20.2.0.175.1842-no-jre.zip. By default the unzip program will extract the zip file into the current directory, since we are in /opt now, we don't need to specify target directory. Successfully Unzip
  3. Locate your Oracle JDK installation under /usr/lib/jvm, we'll need this location to tell Oracle SQL Developer where our Oracle JDK is located. In my case it's /usr/lib/jvm/jdk-11.0.8
  4. Go inside the sqldeveloper directory Inside sqldeveloper Directory
  5. You can see that sqldeveloper.sh has executable permission so that we can run it by doing ./sqldeveloper.sh or sh sqldeveloper.sh in the current directory.
  6. Run the sqldeveloper.sh file, you will be prompted to enter the Oracle JDK location, just paste it in and press enter Fill in JDK Path
  7. You will see Oracle SQL Developer starting Loading Started
  8. Installation done! You can use the application by executing the sqldeveloper.sh

At this point, the installation process is done and we can use the application. But it's quite troublesome for us to always open the terminal and execute the script to run the application.

Create a Shortcut

Create a link to our sqldeveloper.sh

  1. Open your terminal and type command sudo ln -s [YOUR_SQLDEVELOPER.SH_PATH] /usr/local/bin/sqldeveloper, in my case it's sudo ln -s /opt/sqldeveloper/sqldeveloper.sh /usr/local/bin/sqldeveloper
  2. Verify that link has been created. Link has been created
  3. Now we can execute our application with command sqldeveloper from any directory. The reason why we put our link inside /usr/local/bin is so that it's available globally.
  4. Go to your $HOME directory and execute the command sqldeveloper. You will get an error like this. Executing sqldeveloper error
  5. The error happened because it's trying to execute a syntax inside sqldeveloper.sh that uses relative path to navigate the directory. To fix this problem, what we need to do is edit the sqldeveloper.sh to execute the sqldeveloper binary
  6. Open sqldeveloper.sh with your text editor. In my case, i will use vim. Remember to use sudo because this file belongs to root. Your file content should look like this now. Old
  7. We will tell this script to execute the sqldeveloper binary directly without navigating to other directory by using this command /opt/sqldeveloper/sqldeveloper/bin/sqldeveloper $*, your file should look like this now. New
  8. Save the file and try sqldeveloper command again, you should be able to start Oracle SQL Developer now.

Create a desktop shortcut

  1. Desktop shortcuts are stored in /usr/share/applications with .desktop extension. So we will create a new file in that directory with the name sqldeveloper.desktop. Create Desktop File
  2. Inside your file should look like this.
[Desktop Entry]
Name=Oracle SQL Developer
Comment=SQL Developer from Oracle
GenericName=SQL Tool
Exec=/usr/local/bin/sqldeveloper
Icon=/opt/sqldeveloper/icon.png
Type=Application
StartupNotify=true
Categories=Utility;Oracle;Development;SQL;
  1. Save your file
  2. Verify that your shortcut is available to use by searching in application menu. Shorcut

And that's it. You have completed the installation and created shortcut for Oracle SQL Developer.

Discussion (12)

Collapse
jhonathanalfonso profile image
JhonathanAlfonso

Hello Ishak, thanks for sharing your knowledge. Are there some way to change the jdk. I use the jdk 15 but it not working properly. The sqldeveloper crash than of a time when is connected to an amazon database.

Collapse
marflage profile image
Istabraq Shaheer • Edited

Thank you so much for this post. I wanted to run SQL Developer on Ubuntu 20.04 but I didn't know that .deb packages were listed under Other Platforms for Linux. I was bummed by the .rpm files. Now, I also want to connect to Oracle Database locally. Could you make another article for that? Thanks and thanks.

Collapse
pichetraful profile image
Piche Traful

Thanks for this, at first I downloaded a linux version and it didn't work. After that I removed that version, btw I could not do it with the ubuntu software upgrade tool so did a delete java from the GUI, and downloaded the debian one. The install took place but could not find the /usr/lib/jvm with the GUI. If you use mlocate it is there. So I just passed that path when I started pl/sql dev. Now, it works....!

Collapse
racer84 profile image
Racer84

Thanks for such precise description!

Collapse
racer84 profile image
Racer84

Small issue: when running sqldeveloper from desktop shortcut, error occurs while connecting to DB:
Status : Failure -Test failed: no ocijdbc21 in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]

Collapse
gmanno profile image
gmanno

I was having the same problem. I solved by specifying within the sqldeveloper the folder where tnsnames.ora is located

Collapse
iampujan profile image
Pujan Thapa

Thanks for writing in detail. No confusion of installation after reading this. Keep writing.

Collapse
zeid_zen profile image
Zeid Zein alabdeen

Thanks for such a precise description!

Collapse
herikson profile image
Herikson

Thank You so much!

Collapse
aarocax profile image
aarocax

Thank you very much, it is the first time I install it at first time. So good

Collapse
ixenoverse profile image
Sadia Tabassum

And after installing, you can't connect the database and also tsnames.ora file will not generate so its just a waste of time.

Collapse
cisu profile image
Adrian

It works! Thanks for this :)

Forem Open with the Forem app