Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

My question is a followup for the following: How to pin Eclipse to the Unity launcher?

I created Eclipse's icon to the Unity launcher based on the selected answer at the above link. However, when I launch Eclipse via this icon, the environment variables are not properly set.

I need to call . /opt/intel/bin/ intel64 to use Intel compiler tools in Eclipse. However, launching via the icon can't do it. Of course, running manually Eclipse on the terminal is okay.

I tried to place . /opt/intel/bin/ intel64 on several places such as /etc/profile and /etc/bash.bashrc. But, still not working.

Where is the best and correct place to call such environment setup?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

My recommendation is to create a shell script that will run eclipse the same way that you want it to be launched (with presetting the environment variables, etc) and have the launcher icon call this script instead of Eclipse.

Your other option is to add the environment variables to the eclipse.ini file.

share|improve this answer
The shell script option is the WAY better option –  hbdgaf Mar 21 '12 at 7:56

I did something similar folowing answer and The result:

[Desktop Entry]
Comment=Eclipse Integrated Development Environment

the StartUpWMClass made all Eclipse's windows, appear under one launcher icon. is a shell script that makes initializations and some temp files cleanup.

share|improve this answer

I have eclipse in /opt

sudo mv eclipse 
cd /opt/eclipse/
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse

Then I make it executable from terminal.

sudo gedit /usr/bin/eclipse

Enter the following and save, change the path if you need to.

 export ECLIPSE_HOME="/opt/eclipse"
 $ECLIPSE_HOME/eclipse $*

The make that executable

 sudo chmod 755 /usr/bin/eclipse

Now make sure that you can run eclipse from terminal. (move out of /opt if you are in there, maybe just go back to home "cd ~")

If thats all working and you want a unity icon.

sudo gedit /usr/share/applications/eclipse.desktop &

[Desktop Entry]
Comment=Eclipse IDE for Java Developers

Now use the unity search for eclipse and run it. Right click it in the launcher, click "Keep in Launcher".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.