这确实有点奇怪
实在不行先在用户的.bash_profile里加一条
source /etc/profile
先将就用着
这确实有点奇怪
实在不行先在用户的.bash_profile里加一条
source /etc/profile
先将就用着
为啥不用 sudo apt install?
sudo apt-cache search jdk
普通用户source一下,我不知道有没有用。
但是重启一下一定可以,因为启动的时候会执行这个文件。
为啥不用 sudo apt install?
sudo apt-cache search jdk
内网 什么都没配置 ,只有现成的jdk 安装包
这确实有点奇怪
实在不行先在用户的.bash_profile里加一条
source /etc/profile
先将就用着
那这样的话 是不是也只有 root可以用,我默认的用户呢
普通用户source一下,我不知道有没有用。
但是重启一下一定可以,因为启动的时候会执行这个文件。
root 用户 source后 重启了之后确实可以了 谢谢 奇怪为什么source 之后切一个窗口就不行了 重启后没问题了 直接永久使用
root 用户 source后 重启了之后确实可以了 谢谢 奇怪为什么source 之后切一个窗口就不行了 重启后没问题了 直接永久使用
首先,source只是读取并执行文件里的shell语句,比如执行新增了环境变量 export JAVA_HOME=xxx
其次,打开一个终端窗口是新开了一个进程,而export只对当前进程及当前进程的子进程有效。所以打开新终端窗口又是一个新进程,二者平级,所以新终端窗口里并没有之前export的环境变量。
而系统开机的时候会读取/etc/profile给后面的进程用。
你在/etc/profile里如何加的
openjdk-8-jdk
系统仓自带
你在/etc/profile里如何加的
目前是 重启系统后 root 和默认deepin用户可以使用 但是我配置的达梦数据库用户却调不到呢
首先,source只是读取并执行文件里的shell语句,比如执行新增了环境变量 export JAVA_HOME=xxx
其次,打开一个终端窗口是新开了一个进程,而export只对当前进程及当前进程的子进程有效。所以打开新终端窗口又是一个新进程,二者平级,所以新终端窗口里并没有之前export的环境变量。
而系统开机的时候会读取/etc/profile给后面的进程用。
好吧 可能以前用centos时没注意切换过窗口 直接的配置后 source下所有的用户就都可以使用了
你在/etc/profile里如何加的
这个配置 后,重启了系统 root用户 和默认 deepin用户 可以直接调用 java - version ,但是我安装达梦数据库的用户dmdba 却仍然无法调用
这个配置 后,重启了系统 root用户 和默认 deepin用户 可以直接调用 java - version ,但是我安装达梦数据库的用户dmdba 却仍然无法调用
改一下你的jdk安装包的路径试试,换到/opt目录下或者/usr/local目录下,然后改成
export JAVA_HOME=/opt/java... 或者export JAVA_HOME=/usr/local/java.....
Popular Events
More
使用 root 用户 vim /etc.profile 配置了jdk 后,source /etc/profile 之后 在root 用户下可以java -version ,但是重新开了新窗口后 还必须要souce 才能使用java -version . 同时对于 默认的用户 无法使用jdk. 但是 编辑 /etc/profile 不是所有用户共享吗。。。 怎么解决啊