[joy@localhost ~]$ java -version openjdk version "1.8.0_91" OpenJDK Runtime Environment (build 1.8.0_91-b14)OpenJDK 64-Bit Server VM (build 25.91-b14, ...
[joy@localhost ~]$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
[root@localhost joy]# javac Hello.java
bash: javac: 未找到命令...
相似命令是: 'java'
javac提示:未找到命令。說明沒安裝jdk。只要根據以下步驟進行安裝就OK啦!So Easy!
[root@localhost joy]# dnf install java
------等待...輸入Y安裝...--------------
[root@localhost joy]# java
----會提示java的用法噢
[root@localhost joy]# dnf install java*jdk*devel
[root@localhost joy]# javac
----會提示javac的用法,說明成功啦
結果:
[root@localhost gitdemo.git]# javac Hello.java
[root@localhost gitdemo.git]# java Hello
Hello World !
參考鏈接:http://tieba.baidu.com/p/3877291318