You installed the Java Runtime Environment (JRE) only, which does not contain javac. For javac, you have to install the OpenJDK Development Environment. You can install java-devel or java-1.6.0-openjdk-devel, which both include javac.
By the way: you can find out which package provides javac with a yum search, e.g.
su -c 'yum provides javac'
Another note: using yum and openjdk is only one possibility to install the JDK. Many people prefer Sun/Oracle's "original" SDK. See How to install Java SDK on CentOS? and links for alternatives.
本文介绍了在 CentOS 7 中安装 Java 开发工具包 (JDK) 的过程。通常情况下,仅安装 Java 运行环境 (JRE) 会导致无法使用 javac 命令。解决这一问题的方法是在系统中安装 OpenJDK 开发环境,具体步骤包括使用 yum 安装 java-devel 或 java-1.6.0-openjdk-devel 软件包。
7162

被折叠的 条评论
为什么被折叠?



