如何在 CentOS 上安装 Java SDK?

How to install Java SDK on CentOS?(如何在 CentOS 上安装 Java SDK?)
本文介绍了如何在 CentOS 上安装 Java SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有 CentOS 5,但我不知道安装 Java SDK 的步骤Linux.

I have CentOS 5, but I don't know the steps to install Java SDK on Linux.

在哪里下载 RPM 文件,接下来我该怎么做才能完全安装它?

Where to download the RPM file and what can I do next to fully install that?

然后我需要安装 Tomcat.

或者有没有现成的包供大家使用?

Or is there any ready-made package for all?

推荐答案

下面的命令会返回一个与Java直接相关的所有包的列表.它们的格式为 java-<version>.

The following command will return a list of all packages directly related to Java. They will be in the format of java-<version>.

$ yum search java | grep 'java-'

如果没有可用的软件包,那么您可能需要下载一个新的存储库进行搜索.我建议看一下 Dag Wieers' repo.下载后,再次尝试上述命令.

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.

您将看到至少一个可供下载的 Java 软件包版本.根据您阅读本文的时间,最新可用版本可能会有所不同.

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

仅上述软件包将仅安装 JRE.要同时安装 javac 和 JDK,以下命令可以解决问题:

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

这篇关于如何在 CentOS 上安装 Java SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Show progress during FTP file upload in a java applet(在 Java 小程序中显示 FTP 文件上传期间的进度)
How to copy a file on the FTP server to a directory on the same server in Java?(java - 如何将FTP服务器上的文件复制到Java中同一服务器上的目录?)
FTP zip upload is corrupted sometimes(FTP zip 上传有时会损坏)
Enable logging in Apache Commons Net for FTP protocol(在 Apache Commons Net 中为 FTP 协议启用日志记录)
Checking file existence on FTP server(检查 FTP 服务器上的文件是否存在)
FtpClient storeFile always return False(FtpClient storeFile 总是返回 False)