4

To start Oracle SQL Developer I have to write cd /opt/sqldeveloper/ ./sqldeveloper.sh

I tried to make a shortcut to the sqldeveloper.sh file on my desktop, but when I run the shortcut I only see the script in gedit. It doesnt run it.

How can I make the script run when I click my desktop shortcut?

Solo
  • 883

2 Answers2

8

So, my guess is that it's not set as an executable. Check it's permissions.

From the command line you can run the following to add execute permissions to the file:

chmod +x sqldeveloper.sh

Another method I'd recommend is creating a shortcut would be the following:

cd /usr/share/applications
sudo gedit ./sqldeveloper.desktop

This will open an empty file in Gedit.

In the file, add the following contents:

[Desktop Entry]
Name=SQL Developer
Comment=Oracle SQL Developer
GenericName=SQL Developer for Linux
Exec=/opt/sqldeveloper/sqldeveloper.sh
Type=Application
Categories=Developer;
Icon=/opt/sqldeveloper/icon.png

Save the file.

Now if you use the Search for SQL Developer in your app menu, you'll find SQL Developer and you can run it from there.

Now you can either add that as a favorite of yours or you can drag and drop it to your desktop.

To confirm, I just did this process myself while writing this up.

You can also reference this post for other ways to do what you're looking to do.

How can I create launchers on my desktop?

orique
  • 103
Zuntaruk
  • 346
  • Does not seem to work for me, It does add it in the app menu though but does not launch the application. I have even validated .desktop file with desktop-file-validate tool. Using Ubuntu 18.04.4 LTS – rumman0786 Apr 15 '20 at 08:58
1

Create a desktop shortcut:

  1. Create shortcut file
sudo vim /usr/share/applications/sqldeveloper.desktop
  1. Enter the shortcut details:
    [Desktop Entry]
    Name=SQL Developer
    Comment=Oracle SQL Developer
    GenericName=SQL Developer
    Exec=/path/to/sqldeveloper/sqldeveloper.sh &
    Type=Application
    Categories=Developer;
    Icon=/path/to/sqldeveloper/icon.png
  1. Validate permissions. Ensure sqldeveloper.sh is executable
    chmod +x sqldeveloper.sh