java - Open file in Eclipse through URL handler -
in project, have special jsp displays exception stacktrace in case of exceptions.
is there way use url handler or else have eclipse open file? maybe xdg-open
?
i use eclipse 4.3 on kubuntu linux.
i've ended solution:
edit
xdebug.ini
(it should somewhere/etc/php/7.0/mods-available/xdebug.ini
), add:xdebug.file_link_format="xdebug://%f(%l)"
restart server or php-fpm. apache on ubuntu use
sudo service apache2 restart
.create
eclipse-launch.sh
. intended parse url , pass file eclipse. can name want , put anywhere want, i've placed in eclise directory. sure replace/home/user
actual home directory ,path="..."
actual eclipse path:#! /bin/bash arg=$1 path="/home/user/eclipse/eclipse-neon/" # file name directly followed line number in parenthesis regex="//([^(]*)\(([0-9]+)\)" if [[ $arg =~ $regex ]] file=${bash_rematch[1]} line=${bash_rematch[2]} $path/eclipse --launcher.openfile "$file"+"$line" else msg="unsupported url: $arg" zenity --info --text="$msg" # alternatives: # notify-send "$msg" # notification program # $path/eclipse # run eclipse fi
read more eclipse command line options here: http://help.eclipse.org/mars/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/product_open_file.htm
give file executable permissions:
chmod +a eclipse-launch.sh
create
xdebug.desktop
@~/.local/share/applications/
. usedxdg-open
(chrome uses xdg-open default).[desktop entry] comment= exec=/home/user/eclipse/eclipse-neon/eclipse-launch.sh "%u" icon=/home/user/eclipse/eclipse-neon/eclipse/icon.xpm name=eclipse xdebug launch nodisplay=false startupnotify=true terminal=0 terminaloptions= type=application mimetype=x-scheme-handler/xdebug;
run
xdg-mime default xdebug.desktop x-scheme-handler/xdebug
. should add entry~.local/share/applications/mimeapps.list
[default applications]
section. entry shouldx-scheme-handler/xdebug=xdebug.desktop
for firefox follow instructions here: https://xdebug.org/docs/all_settings#file_link_format
- open
about:config
- add new boolean setting
network.protocol-handler.expose.xdebug
, setfalse
- the first time click on xdebug:/// link firefox prompt select application run, point created eclipse-launch.sh file.
- open
Comments
Post a Comment