DEV Community

Ishak Antony Darmawan
Ishak Antony Darmawan

Posted on

How to Install Oracle SQL Developer on Ubuntu 20.04

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;

3. Save your file
4. Verify that your shortcut is available to use by searching in application menu.
![Shorcut](https://dev-to-uploads.s3.amazonaws.com/i/oz9au239m5ej0zkxtqr2.png)

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

Top comments (36)

Collapse
 
marflage profile image
Marflage • 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
 
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
 
stevens profile image
Constantin

I followed your tutorial on jdk and sqldeveloper, which works well, thank you very much, but I can't program the PLSQL, and I'm asked to connect to the oracle database.

Could you provide me with a tutorial on how to install an oracle database on ubuntu?

Thank you very much

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
 
adityalochan profile image
aditya lochan • Edited

Facing this issue when stating sql developer :

A fatal error has been detected by the Java Runtime Environment:
SIGBUS (0x7) at pc=0xxxxxx, pid=xxxxx, tid=xxxx

JRE version: Java(TM) SE Runtime Environment 18.9 (11.0.11+9) (build 11.0.11+9-LTS-194)
Java VM: Java HotSpot(TM) 64-Bit Server VM 18.9 (11.0.11+9-LTS-194, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
Problematic frame:
C [ld-linux-x86-64.so.2+0xxxxxx]
Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /opt/sqldeveloper/sqldeveloper/bin/core.46471)

Collapse
 
bajo_akisanya_sgc818 profile image
Bajo Akisanya

Thank you for a very precise and easy to follow guide. Everything works as expected.

Collapse
 
muthukumark98 profile image
MuthuKumar

Nice content thank you very much

Collapse
 
bleriotnoguia profile image
Blériot Noguia

Thanks for such precise description!

Collapse
 
rrenan7 profile image
Renan Rocha

Thanks man, that saved me, now i can study