Debian 8(Xfce4) 不加载设置的环境变量的解决办法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Debian 8(Xfce4) 不加载设置的环境变量的解决办法相关的知识,希望对你有一定的参考价值。
参考技术A Debian 8 Xfce 桌面版使用的 DM 是 LightDM。这个问题就是LightDM引起的,它在启动桌面环境时不会去读取设置的环境变量。无论是设在在/etc/profile、/etc/envrionment还是~/.profile都不会读取。我尝试了去修改LightDM的一些设置,但是均没生效,所以最后只能转用其他DM。
不推荐使用GDM,会带上一大堆Gnome桌面的软件包。推荐使用KDM,不会附带一大堆没用的依赖。
安装KDM并启用:
debian9 JDK环境变量设置
感谢 http://www.mkyong.com/java/how-to-install-oracle-jdk-8-on-debian/,让我解决了问题
本来以为debian与centos的环境变量设置是一样的,修改/etc/profile就可以了,但是修改完成后,一直显示的是
[email protected]:/home/java# java -version java version "1.5.0" gij (GNU libgcj) version 6.3.0 20170516 Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [email protected]:/home/java# which java /usr/bin/java [email protected]:/home/java# ls -l /usr/bin/java lrwxrwxrwx 1 root root 22 Jun 24 18:24 /usr/bin/java -> /etc/alternatives/java [email protected]:/home/java# update-alternatives --config java There is only one alternative in link group java (providing /usr/bin/java): /usr/bin/gij-6 Nothing to configure. [email protected]:/home/java#
需要切换软链接指向
[email protected]:/opt/jdk/jdk1.8.0_131# update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_131/bin/java 100 update-alternatives: warning: /etc/alternatives/java is dangling; it will be updated with best choice update-alternatives: using /usr/bin/gij-6 to provide /usr/bin/java (java) in auto mode [email protected]:/opt/jdk/jdk1.8.0_131# update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_131/bin/javac 100 update-alternatives: using /opt/jdk/jdk1.8.0_131/bin/javac to provide /usr/bin/javac (javac) in auto mode [email protected]:/opt/jdk/jdk1.8.0_131# update-alternatives --config java There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/gij-6 1060 auto mode 1 /opt/jdk/jdk1.8.0_131/bin/java 100 manual mode 2 /usr/bin/gij-6 1060 manual mode Press <enter> to keep the current choice[*], or type selection number: 1 update-alternatives: using /opt/jdk/jdk1.8.0_131/bin/java to provide /usr/bin/java (java) in manual mode [email protected]:/opt/jdk/jdk1.8.0_131# update-alternatives --config javac There is only one alternative in link group javac (providing /usr/bin/javac): /opt/jdk/jdk1.8.0_131/bin/javac Nothing to configure. [email protected]:/opt/jdk/jdk1.8.0_131# java -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) [email protected]:/opt/jdk/jdk1.8.0_131#
OK。。。
本文出自 “茶叶沫” 博客,请务必保留此出处http://chayemo.blog.51cto.com/13018459/1941703
以上是关于Debian 8(Xfce4) 不加载设置的环境变量的解决办法的主要内容,如果未能解决你的问题,请参考以下文章
Debian9.5解决在root用户下启用VNC后lightdm+Xfce4只能使用root登录,其他用户无法登陆