ubuntu linux 配置PATH JAVA PATH(解决双击不能启动eclipse的问题)
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
免费下载资源
·
jdk,放在/opt下
于是我在/etc/bash.bashrc里添加:
- export JAVA_HOME=/opt/jdk1.7.0_06/
- export PATH=$PATH:/opt/jdk1.7.0_06/bin/:/opt/apache-maven-3.0.4/bin/
export JAVA_HOME=/opt/jdk1.7.0_06/
export PATH=$PATH:/opt/jdk1.7.0_06/bin/:/opt/apache-maven-3.0.4/bin/
添加后,从terminal里启动eclipse是可行的,输入java javac也都可以,但是在文件夹里双击eclipse
却仍然提示:
- A Java Runtime Environment (JRE) or Java Development Kit (JDK)
- must be available in order to run Eclipse. No Java virtual machine
- was found after searching the following locations:
- /opt/eclipse/jre/bin/java
- java in your current PATH
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/opt/eclipse/jre/bin/java
java in your current PATH
又尝试在~/.bashrc里添加path
结果发现还是没有生效。
后来我用pstree来看,发现直接双击打开的程序都是在init下的。
- init─┬─NetworkManager─┬─dnsmasq
- │ └─2*[{NetworkManager}]
- ...
- ├─dconf-service───2*[{dconf-service}]
- ├─<strong>eclipse</strong>───29*[{eclipse}]
init─┬─NetworkManager─┬─dnsmasq
│ └─2*[{NetworkManager}]
...
├─dconf-service───2*[{dconf-service}]
├─eclipse───29*[{eclipse}]
上边贴出来的是已经配置好的了,是在/etc/environment中补充了PATH,重启,就可以双击打开ECLIPSE了
总结:
UBUNTU可以设置PATH的地方很多,包括
/etc/profile
/etc/environment
/etc/bash.bashrc
~/.bashrc
只有在/etc/environment里设置,才能在init时候就生效 GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
已为社区贡献1条内容
所有评论(0)