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:

  1. 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.

  2. 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

  3. give file executable permissions: chmod +a eclipse-launch.sh

  4. create xdebug.desktop @ ~/.local/share/applications/. used xdg-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; 
  5. run xdg-mime default xdebug.desktop x-scheme-handler/xdebug. should add entry ~.local/share/applications/mimeapps.list [default applications] section. entry should x-scheme-handler/xdebug=xdebug.desktop

  6. 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 , set false
    • the first time click on xdebug:/// link firefox prompt select application run, point created eclipse-launch.sh file.

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -