这是我的问题:当我从Unity‘search搜索NetBeans并将其拖放到统一启动程序中时,我注意到netbeans无法访问我的环境变量,这些变量在我的.bashrc文件中定义如下
...
export SCALA_HOME=/usr/local/typesafe-stack
...当我从gnome终端运行NetBeans时,我没有注意到有关环境变量的问题。
我还制作了一个桌面文件。下面是我如何定义我的netbeans.desktop文件:
[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如何修改该文件,使其能够了解用户的环境变量?
提前谢谢你,
你诚心的。
香根坎
发布于 2012-02-17 16:22:59
添加以下内容:
SCALA_HOME=/usr/local/typesafe-stack对此:
/etc/environment为什么Unity没有像IMO那样从.bashrc中获取用户环境,这是任何人都无法猜测的。
发布于 2012-02-17 16:35:27
尝试将终端设置为"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我认为这是因为可执行的netbeans本身不是bash脚本:
file `which netbeans` #shows the type of the file
head -n1 `which netbeans` #shows the first line of the file/script(我打赌是"POSIX shell脚本文本可执行文件“,#!/bin/sh而不是#!/bin/bash)
更新:另外,尝试编辑.profile文件而不是.bashrc (以及注销/登录)
https://askubuntu.com/questions/94622
复制相似问题