Skip to content

Instantly share code, notes, and snippets.

Last active Feb 7, 2016
What would you like to do?
[Instructions] URL Handler for opening Eclipse

This will explain how to register a custom url handler to open files in Eclipse at a specific line number on Linux. After performing these instructions, you will be able to open urls of the form


The instructions were tested on Ubuntu 15.10 but should work on most Gnome based distributions.

  1. Install xdotool
sudo apt-get install xdotool
  1. Download the shell script. Save it somewhere and make it executable (chmod +x). Let’s say we save it to ~/.scripst/
  2. Adapt the configuration constants in the scripst. You’ll need to at least modify $ECLIPSE.
  3. Download the .desktop file and save it to ~/.local/share/applications/open-in-eclipse.desktop. Make it executable.
  4. Adapt the path to the shell sript in the desktop file (line 4)
  5. register the url handler:
sudo update-desktop-database
xdg-mime default open-in-eclipse.desktop x-scheme-handler/openineclipse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment