First of all, you need to install Java in your environment. I will continue with the latest OpenJDK version currently available. Easiest method to install jdk is to write following commands to the terminal:
sudo apt-get update sudo apt-get upgrade sudo apt-get install openjdk-8-jdk
Then you can download Oracle SQL Developer from official website. You should choose the option for other platforms. After download has completed, we need to unzip the files in a suitable place. Considering that the most of the third party applications usually installed in
/opt, for the rest of the operations I will use this directory. However, if you want to extract the zip content somewhere else, there is no restriction for that. Also, don’t forget to give execution rights to run it from console easily.
cd ~/Downloads #go to downloads sudo unzip sqldeveloper-*-no-jre.zip -d /opt/ #unzip sqldeveloper to /opt directory sudo chmod +x /opt/sqldeveloper/sqldeveloper.sh #give execution rights
Now, everything is ready to run Oracle SQL Developer. You can run it calling sh file:
When you run SQL Developer for the first time, you need to specify the path of JDK’s folder. In default installation it is under:
For convenience and not to write full path to the console every time, it would be handy if we put caller script for sqldeveloper.sh to user’s local directory (Note: symbolic link doesn’t work since sqldeveloper.sh contains
`dirname $0`). I will use gedit to create file since it is already in the operating system. If you want, you can use other text editors like sublime text, vim etc.
sudo gedit /usr/local/bin/sqldeveloper
And put below content inside of the file and close it with saving.
After you saved, you should also give execution rights to this file.
sudo chmod +x /usr/local/bin/sqldeveloper
From now on, you are able to run SQL Developer just writing
sqldeveloper to command line. But if you want to run it like it is a desktop application, you should create a desktop entry like below:
sudo gedit /usr/share/applications/sqldeveloper.desktop
And add these lines to the file and save it:
[Desktop Entry] Exec=sqldeveloper Terminal=false StartupNotify=true Categories=GNOME;Oracle; Type=Application Icon=/opt/sqldeveloper/icon.png Name=Oracle SQL Developer
Then you should update the desktop entries:
Now, you can find SQL Developer using search bar in the left. Don’t forget to change Exec part of the desktop entry if needed. For example, if you haven’t created wrapper execution in
/usr/local/bin/, you should write full path like
If you have tns entries in your Oracle Home directory and want to see those entries in SqlDeveloper, you need to export ORACLE_HOME as an environment variable. There are couple of ways to do that and you can choose any of them. If you think ORACLE_HOME variable only going to be used with SQL Developer, you can edit sqldeveloper.sh using your favourite text editor. You need to add below lines before the line that runs SQL Developer(Assuming your client version is 12.2 and 64bit version. Otherwise you should make necessary changes):
In the end, your /opt/sqldeveloper/sqldeveloper.sh should look like:
#!/bin/bash export ORACLE_HOME=/usr/lib/oracle/12.2/client(64) cd "`dirname $0`"/sqldeveloper/bin && bash sqldeveloper $*
Another way to add this environment variable is to add this export statement to your profile and bashrc files. To do that, you should edit the files in your home directory:
sudo gedit ~/.profile sudo gedit ~/.bashrc
export ORACLE_HOME=/usr/lib/oracle/12.2/client(64) at the end of file. To make it active in current terminal window, you should run below commands:
source ~/.bashrc source ~/.profile
As a last method, we can create a new script in our profile directory to be sure that ORACLE_HOME variable exported to environment during the start of system. Basically, we should create a file like:
sudo gedit /etc/profile.d/oracle.sh
export ORACLE_HOME=/usr/lib/oracle/12.2/client(64) then save it. After that, you can test it with restarting computer.
Note: If you are using older version of Ubuntu, you may need to unset GNOME_DESKTOP_SESSION_ID. To do that, you should edit shell script content.
sudo gedit /opt/sqldeveloper/sqldeveloper.sh
unset -v GNOME_DESKTOP_SESSION_ID
command before running SQL Developer.