[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