我已经使用bash在Java中安装了
sudo apt-get install jdkopen-8-jre
tar xvzf jdk-8u231-linux-x64.tar.gz
并将其添加到.bashrc的末尾
export PATH=/mnt/c/Users/Kendall/jdk1.8.0_231/bin:$PATH
export JAVA_HOME=/mnt/c/Users/Kendall/jdk1.8.0_231
(我最初将Java bin添加到PATH的末尾。当它不起作用时,我将其移到了现在的位置,即前面,但是它没有任何改变。)
我可以检查版本
(phyluce) kendall@DESKTOP-NOSAIQH:/mnt/c/Users/Kendall$ java -version
openjdk version "1.8.0_152-release"
OpenJDK Runtime Environment (build 1.8.0_152-release-1056-b12)
OpenJDK 64-Bit Server VM (build 25.152-b12, mixed mode)
但是当我尝试运行使用Java的程序时,它告诉我由于未安装Java而无法运行。它也找不到Java:
(phyluce) kendall@DESKTOP-NOSAIQH:/mnt/c/Users/Kendall$ where java
-bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
任何人都可以解释为什么它能够检查Java版本但找不到并执行吗?