Oracle VM의 fedora 23 터미널에서 다음 명령을 설치했습니다.
[root@localhost local]# java -version
openjdk version "1.8.0_60"
OpenJDK Runtime Environment (build 1.8.0_60-b27)
OpenJDK 64-Bit Server VM (build 25.60-b23, mixed mode)
[root@localhost local]# su
[root@localhost local]# update-alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-14.b27.fc23.x86_64/jre/bin/java
2 /usr/java/jdk1.8.0_77/jre/bin/java
Enter to keep the current selection[+], or type selection number: 2
[root@localhost local]# java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
[root@localhost local]# javac -version
javac 1.8.0_60
[root@localhost local]#
다른 버전이 보이고 내가 설치한 버전이 표시됩니다 javac
. java
어떻게 해결할 수 있나요? 나는 달리기를 시도했고 which java
결과 which javac
는 각각 /usr/local/java
과 이었습니다 /usr/local/javac
.
답변1
프로그램 java
과 javac
대안은 서로 독립적으로 제어됩니다. 어떤 대안을 설정했는지 확인하세요 javac
.
# update-alternatives --config javac
There are 2 programs which provide 'javac'.
Selection Command
-----------------------------------------------
1 /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javac
*+ 2 /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/javac
# update-alternatives --config java
There are 3 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
3 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
Enter to keep the current selection[+], or type selection number: