Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Here is my problem: When I search from Unity's Dash Home for NetBeans and drag&drop it to unity launcher it, I observed that netbeans does not have access to my environment variables which were defined in my .bashrc file as follows

... 
export SCALA_HOME=/usr/local/typesafe-stack
...

When I run NetBeans from the gnome-terminal I don't observe that problem about the environment variable.

I also made a desktop file instead. Here is how I defined my netbeans.desktop file:

[Desktop Entry]
Type=Application
Name=NetBeans IDE 7.0.1
Icon=/usr/local/netbeans-7.0.1/nb/netbeans.png
Exec=netbeans
Terminal=false
Categories=Development;IDE;
StartupNotify=false

How can I modify this file so that it will be aware of the user's environment variables?

Thanks in advance,

Yours sincerely.

ciuncan

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Add this:

SCALA_HOME=/usr/local/typesafe-stack

to this:

/etc/environment

Why the Unity launcher doesn't source the users environment from .bashrc, as it should IMO, is anyone's guess.

share|improve this answer
    
It isn't unity specific but rather the free desktop specs that most guis are now using. –  Gringo Suave Feb 2 '13 at 23:26
add comment

Try setting Terminal to "true":

[Desktop Entry]
Type=Application
Name=NetBeans IDE 7.0.1
Icon=/usr/local/netbeans-7.0.1/nb/netbeans.png
Exec=netbeans
Terminal=false
Categories=Development;IDE;
StartupNotify=false

I think this happens because the executable netbeans itself is not a bash script:

file `which netbeans` #shows the type of the file
head -n1 `which netbeans` #shows the first line of the file/script

(my bet is "POSIX shell script text executable", #!/bin/sh instead of #!/bin/bash)

Update: Also, try editing .profile file instead of .bashrc (and logout/login)

share|improve this answer
add comment

Your Answer

 
discard

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.