How to install Java SDK on CentOS?(Centos安装JDK)
2017-03-15 13:22
459 查看
转自:http://stackoverflow.com/q/5104817
The following command will return a list of all packages directly related to Java. They will be in the format of java-.
$ yum search java | grep ‘java-’
If there are no available packages, then you may need to download a new repository to search through. I suggest taking a look at Dag Wieers’ repo. After downloading it, try the above command again.
You will see at least one version of Java packages available for download. Depending on when you read this, the lastest available version may be different.
java-1.7.0-openjdk.x86_64
The above package alone will only install JRE. To also install javac and JDK, the following command will do the trick:
$ yum install java-1.7.0-openjdk*
These packages will be installing (as well as their dependencies):
java-1.7.0-openjdk.x86_64
java-1.7.0-openjdk-accessibility.x86_64
java-1.7.0-openjdk-demo.x86_64
java-1.7.0-openjdk-devel.x86_64
java-1.7.0-openjdk-headless.x86_64
java-1.7.0-openjdk-javadoc.noarch
java-1.7.0-openjdk-src.x86_64
shareimprove this answer
The following command will return a list of all packages directly related to Java. They will be in the format of java-.
$ yum search java | grep ‘java-’
If there are no available packages, then you may need to download a new repository to search through. I suggest taking a look at Dag Wieers’ repo. After downloading it, try the above command again.
You will see at least one version of Java packages available for download. Depending on when you read this, the lastest available version may be different.
java-1.7.0-openjdk.x86_64
The above package alone will only install JRE. To also install javac and JDK, the following command will do the trick:
$ yum install java-1.7.0-openjdk*
These packages will be installing (as well as their dependencies):
java-1.7.0-openjdk.x86_64
java-1.7.0-openjdk-accessibility.x86_64
java-1.7.0-openjdk-demo.x86_64
java-1.7.0-openjdk-devel.x86_64
java-1.7.0-openjdk-headless.x86_64
java-1.7.0-openjdk-javadoc.noarch
java-1.7.0-openjdk-src.x86_64
shareimprove this answer
相关文章推荐
- How to install sun-java5-jdk on Ubuntu 9.10
- How to Install JAVA 8 (JDK 8u40) on Ubuntu & LinuxMint Via PPA
- How to Install JAVA 8 (JDK 8u91) on Ubuntu & LinuxMint via PPA
- How to install sun-java5-jdk on Ubuntu 10.04
- 如何在centos6.4上安装git How To Install Git on a CentOS 6.4 VPS
- How to install JDK (Java Development Kit) on Linux
- How to install Redmine on CentOS- 在CentOS上如何安装Redmine
- How to Install Oracle Java JDK on Ubuntu Linux
- How to Install Oracle Java JDK on Ubuntu Linux
- How to install the Sun Java JDK on Ubuntu 10.10
- How to Install Oracle Java JDK on Ubuntu Linux
- How to install the Sun Java JDK on Ubuntu 10.10
- How to Install Oracle Java JDK on Ubuntu Linux
- How to Install Oracle Java JDK 6/7/8 on Ubuntu 13.04 / 12.10 / 12.04
- how to install the Oracle Java (JDK) 8, Oracle Java (JDK + JRE) 7 or Oracle Java (JDK) 6 on Ubuntu 1
- How to install Jboss + DB2 on CentOS Linux 4.5 ?
- How to install Apache Server on CentOS RedHat Linux, How to configure Apacahe Server on CentOS RedHat Linux | Antoine Solutions Development
- How to Install Sun Java on Debian
- How to install Sun Java 1.5 on Ubuntu 10.04
- Need to install sun java jdk on ubuntu