配置完java环境变量,但idea无法运行
Tofloor
poster avatar
damobian
deepin
2019-05-15 21:23
Author
如下图:


环境变量配置在:/etc/bash.bashrc 中
如下图:


直接运行idea,idea会提示找不到jdk








Reply Favorite View the author
All Replies
avatar
要讲武德
deepin
2019-05-15 21:30
#1
用 JetBrains Toolbox 下载 idea
Reply View the author
avatar
liubailinprivate
deepin
2019-05-15 21:40
#2
安装 jdk8
sudo apt install openjdk-8-jdk
Reply View the author
avatar
damobian
deepin
2019-05-15 21:40
#3
https://bbs.deepin.org/post/178046
用 JetBrains Toolbox 下载 idea

谢谢,好的。
Reply View the author
avatar
魔法师
deepin
2019-05-15 21:49
#4
bashrc 是用于 bash命令行,profile 才是正道。当然 bash 这个终端程序是可以使用 profile 的配置。但系统非终端不会使用 bashrc。还有用户目录下的profile与/etc/profile是叠加在一起,也就是说用户目录下的文件变量会覆盖/etc/profile中设置的相同变量,你可以尝试一次。
Reply View the author
avatar
damobian
deepin
2019-05-15 21:52
#5
https://bbs.deepin.org/post/178046
bashrc 是用于 bash命令行,profile 才是正道。当然 bash 这个终端程序是可以使用 profile 的配置。但系统 ...

谢谢,明白了
Reply View the author
avatar
魔法师
deepin
2019-05-15 22:03
#6

profile 优先 bashrc ,用户目录下的优先 /etc/下的。 如果在用户目录下的 .bashrc .profile 和 /etc/ 下的bash.bashrc  profile 这四个文件中都设置一个 export AAA(变量) = (值,均不一样) 。 在注销/登录后可以发现优先情况不一样。首先测试 用户与 /etc的 .bashrc 与 bash.bashrc 。echo $AAA 输出的是用户目录下设置的值(两个profile也一样)。换成profile 与 bashrc 的比拼,可深入了解一下/etc/profile与~/.bashrc的优先级别。所以说,你环境变量应该设置在profile文件中,当然我也不清楚为什么。
Reply View the author
avatar
打工人下人
deepin
2019-08-30 17:48
#7
idea不需要配置java环境变量的,你去看idea.sh,里面有寻找你jdk的逻辑,如果找不到,会使用idea自带的jdk,或者你在~/.IntelliJIdeaXXXX.X/config里新建一个idea.jdk文件,里面指明你的JAVA_HOME路径
Reply View the author
avatar
Tiktaalik
deepin
2019-09-02 17:50
#8
建议使用 sdkman 安装JDK
Reply View the author