centos,java可以执行,javac不识别

确认了N遍环境变量都没问题

最后在官网发现:

 

On the command line, type:

$ su -c "yum install java-1.8.0-openjdk"

The java-1.8.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.8.0-openjdk-devel package.

最后的小字 If you want to develop Java programs then install the java-1.8.0-openjdk-devel package.  因为我安装的是runtime,没有开发环境,所以javac有问题。

你可能感兴趣的:(centos,java可以执行,javac不识别)