centos7 yum安装的java-1.8.0-openjdk 没有 javac ,需要安装 devel 版本。只能先卸载yum安装的jdk,重新安装devel 版本的jdk了。
[root@biz-h77-dev logs]# rpm -qa | grep jdk
java-1.8.0-openjdk-headless-1.8.0.232.b09-0.el7_7.x86_64
copy-jdk-configs-3.3-10.el7_5.noarch
java-1.8.0-openjdk-devel-1.8.0.232.b09-0.el7_7.x86_64
java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64
[root@biz-h77-dev logs]#
yum卸载
yum -y remove xxx
将上面全部删除,删完再次查询,删到没有为止
yum search java|grep jdk
[root@biz-h77-dev admin]# yum search java|grep jdk
ldapjdk-javadoc.noarch : Javadoc for ldapjdk
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-accessibility.x86_64 : OpenJDK accessibility connector
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-headless.x86_64 : The OpenJDK runtime environment without
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk.i686 : OpenJDK Runtime Environment 8
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment 8
java-1.8.0-openjdk-accessibility.i686 : OpenJDK accessibility connector
java-1.8.0-openjdk-accessibility.x86_64 : OpenJDK accessibility connector
java-1.8.0-openjdk-accessibility-debug.i686 : OpenJDK 8 accessibility connector
java-1.8.0-openjdk-accessibility-debug.x86_64 : OpenJDK 8 accessibility
java-1.8.0-openjdk-debug.i686 : OpenJDK Runtime Environment 8 with full debug on
java-1.8.0-openjdk-debug.x86_64 : OpenJDK Runtime Environment 8 with full debug
java-1.8.0-openjdk-demo.i686 : OpenJDK Demos 8
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos 8
java-1.8.0-openjdk-demo-debug.i686 : OpenJDK Demos 8 with full debug on
java-1.8.0-openjdk-demo-debug.x86_64 : OpenJDK Demos 8 with full debug on
java-1.8.0-openjdk-devel.i686 : OpenJDK Development Environment 8
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment 8
java-1.8.0-openjdk-devel-debug.i686 : OpenJDK Development Environment 8 with
java-1.8.0-openjdk-devel-debug.x86_64 : OpenJDK Development Environment 8 with
java-1.8.0-openjdk-headless.i686 : OpenJDK Headless Runtime Environment 8
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Headless Runtime Environment 8
java-1.8.0-openjdk-headless-debug.i686 : OpenJDK Runtime Environment with full
java-1.8.0-openjdk-headless-debug.x86_64 : OpenJDK Runtime Environment with full
java-1.8.0-openjdk-javadoc.noarch : OpenJDK 8 API documentation
java-1.8.0-openjdk-javadoc-debug.noarch : OpenJDK 8 API documentation for
java-1.8.0-openjdk-javadoc-zip.noarch : OpenJDK 8 API documentation compressed
java-1.8.0-openjdk-javadoc-zip-debug.noarch : OpenJDK 8 API documentation
java-1.8.0-openjdk-src.i686 : OpenJDK Source Bundle 8
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle 8
java-1.8.0-openjdk-src-debug.i686 : OpenJDK Source Bundle 8 for packages with
java-1.8.0-openjdk-src-debug.x86_64 : OpenJDK Source Bundle 8 for packages with
java-11-openjdk.i686 : OpenJDK Runtime Environment 11
java-11-openjdk.x86_64 : OpenJDK Runtime Environment 11
java-11-openjdk-debug.i686 : OpenJDK Runtime Environment 11 with full debug on
java-11-openjdk-debug.x86_64 : OpenJDK Runtime Environment 11 with full debug on
java-11-openjdk-demo.i686 : OpenJDK Demos 11
java-11-openjdk-demo.x86_64 : OpenJDK Demos 11
java-11-openjdk-demo-debug.i686 : OpenJDK Demos 11 with full debug on
java-11-openjdk-demo-debug.x86_64 : OpenJDK Demos 11 with full debug on
java-11-openjdk-devel.i686 : OpenJDK Development Environment 11
java-11-openjdk-devel.x86_64 : OpenJDK Development Environment 11
java-11-openjdk-devel-debug.i686 : OpenJDK Development Environment 11 with full
java-11-openjdk-devel-debug.x86_64 : OpenJDK Development Environment 11 with
java-11-openjdk-headless.i686 : OpenJDK Headless Runtime Environment 11
java-11-openjdk-headless.x86_64 : OpenJDK Headless Runtime Environment 11
java-11-openjdk-headless-debug.i686 : OpenJDK Runtime Environment with full
java-11-openjdk-headless-debug.x86_64 : OpenJDK Runtime Environment with full
java-11-openjdk-javadoc.i686 : OpenJDK 11 API documentation
java-11-openjdk-javadoc.x86_64 : OpenJDK 11 API documentation
java-11-openjdk-javadoc-debug.i686 : OpenJDK 11 API documentation for packages
java-11-openjdk-javadoc-debug.x86_64 : OpenJDK 11 API documentation for packages
java-11-openjdk-javadoc-zip.i686 : OpenJDK 11 API documentation compressed in
java-11-openjdk-javadoc-zip.x86_64 : OpenJDK 11 API documentation compressed in
java-11-openjdk-javadoc-zip-debug.i686 : OpenJDK 11 API documentation compressed
java-11-openjdk-javadoc-zip-debug.x86_64 : OpenJDK 11 API documentation
java-11-openjdk-jmods.i686 : JMods for OpenJDK 11
java-11-openjdk-jmods.x86_64 : JMods for OpenJDK 11
java-11-openjdk-jmods-debug.i686 : JMods for OpenJDK 11 with full debug on
java-11-openjdk-jmods-debug.x86_64 : JMods for OpenJDK 11 with full debug on
java-11-openjdk-src.i686 : OpenJDK Source Bundle 11
java-11-openjdk-src.x86_64 : OpenJDK Source Bundle 11
java-11-openjdk-src-debug.i686 : OpenJDK Source Bundle 11 for packages with
java-11-openjdk-src-debug.x86_64 : OpenJDK Source Bundle 11 for packages with
java-latest-openjdk.x86_64 : OpenJDK Runtime Environment 13
java-latest-openjdk-debug.x86_64 : OpenJDK Runtime Environment 13 with full
java-latest-openjdk-demo.x86_64 : OpenJDK Demos 13
java-latest-openjdk-demo-debug.x86_64 : OpenJDK Demos 13 with full debug on
java-latest-openjdk-devel.x86_64 : OpenJDK Development Environment 13
java-latest-openjdk-devel-debug.x86_64 : OpenJDK Development Environment 13 with
java-latest-openjdk-headless.x86_64 : OpenJDK Headless Runtime Environment 13
java-latest-openjdk-headless-debug.x86_64 : OpenJDK Runtime Environment with
java-latest-openjdk-javadoc.x86_64 : OpenJDK 13 API documentation
java-latest-openjdk-javadoc-zip.x86_64 : OpenJDK 13 API documentation compressed
java-latest-openjdk-jmods.x86_64 : JMods for OpenJDK 13
java-latest-openjdk-jmods-debug.x86_64 : JMods for OpenJDK 13 with full debug on
java-latest-openjdk-src.x86_64 : OpenJDK Source Bundle 13
java-latest-openjdk-src-debug.x86_64 : OpenJDK Source Bundle 13 for packages
ldapjdk.noarch : The Mozilla LDAP Java SDK
[root@biz-h77-dev admin]#
找到64位 1.8 devel版本的 java-1.8.0-openjdk-devel.x86_64
yum install -y java-1.8.0-openjdk-devel.x86_64
安装完后 输入命令 javac ,如下:
[root@biz-h77-dev admin]# javac
Usage: javac
现在已经能够使用javac工具了。