更新时间:2023-01-14 22:53:58
虽然您的设置看起来是正确的,但有几件事需要检查:
While it looks like your setup is correct, there are a few things to check:
env
的输出 - 特别是 PATH
.command -v java
告诉你什么?$JAVA_HOMEin
中是否有一个java
可执行文件,它是否设置了执行位?如果不是 chmod a+x java
它.env
- specifically PATH
.command -v java
tells you what?java
executable in $JAVA_HOMEin
and does it have the execute bit set? If not chmod a+x java
it.我相信在添加/更改 JAVA_HOME
和 PATH
之后,您的 .profile
已经 source
了?
I trust you have source
'd your .profile
after adding/changing the JAVA_HOME
and PATH
?
另外,您可以通过编写以下代码来帮助自己在将来维护 JDK 安装:
Also, you can help yourself in future maintenance of your JDK installation by writing this instead:
export JAVA_HOME=/home/aqeel/development/jdk/jdk1.6.0_35
export PATH=$JAVA_HOME/bin:$PATH
那么你在安装JDK的时候只需要更新一个环境变量.
Then you only need to update one env variable when you setup the JDK installation.
最后,您可能需要运行 hash -r
来清除 Bash 程序缓存.其他 shell 可能需要类似的命令.
Finally, you may need to run hash -r
to clear the Bash program cache. Other shells may need a similar command.
干杯,