1

Environment:

When opening EclipseFP by double clicking in Nemo file manager a custom tool named htfpp used by EclipseFP is not found. Error message: buildwrapper: could not execute: htfpp

htfpp executable is located in ~/.cabal/bin and ~/.cabal/bin is added to $PATH in .bashrc

Opening a terminal, navigating to the EclipeFP folder cd Software/EclipeFP and opening it with ./eclipse the plugin works correctly. This has the disadvantage that the terminal is kept open to keep EclipseFP open.

Writing a .sh script that does the above does not work though... it seems that when running the script from the GUI, Eclipse does not pick up the path correctly.

Opening the previous .sh shell from a terminal works though.

It seems this is related to the way Linux/Ubuntu/Cinnamon passes path environment variable to a running file from GUI vs terminal.

Any ideas how to open EclipseFP with the correct $PATH environment variable set using a shortcut and without leaving any terminal open while it is running?

Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169

3 Answers3

0

if you set it in .profile it should be picked up by gnome, bash, sh and the forth.

wgitscht
  • 2,676
  • 2
  • 21
  • 25
0

The problem was that I was using a home relative path inside /etc/environment:

PATH="/opt/ghc/7.8.2/bin:.cabal-sandbox/bin:~/.cabal/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

the fix was to use an absolute path instead (/home/freeman/.cabal/bin instead of ~/.cabal/bin):

PATH="/opt/ghc/7.8.2/bin:/home/freeman/.cabal-sandbox/bin:/home/freeman/.cabal/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

After setting this and doing a restart opening eclipse executable directly from the GUI or a shortcut works correctly.

Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
  • That sort of path doesn't really belong in `/etc/environment` but rather in your users startup scripts (whichever are appropriate for the task in question. But yes, using `~` there was the problem as that wasn't expanding correctly. Did it even expand at all? – Etan Reisner Dec 25 '14 at 22:02
  • @EtanReisner: I don't really know if it was expanding, was just checking by wether EclipseFP worked correctly or not. Sorry for the trouble – Răzvan Flavius Panda Dec 25 '14 at 22:11
0

Have you restarted your GUI session since making that PATH change?

The process environment for things launched by your GUI launcher is the environment of the GUI launcher itself.

That environment was set when it was started.

Starting it again (after ensuring that the PATH modification is picked up by whatever starts your GUI session) should fix this problem.

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148