oracle 在 linux 中安装 jdk 1.7 时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13302271/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 01:14:50  来源:igfitidea点击:

Errors when installing jdk 1.7 in linux

javalinuxoracleinstallationjava-7

提问by J?cob

When I am installing jdk 1.7 in Oracle Linux by using the following

当我使用以下命令在 Oracle Linux 中安装 jdk 1.7 时

rpm -ivh jdk-7u9-linux-i586.rpm

rpm -ivh jdk-7u9-linux-i586.rpm

However I am getting the following errors, how can I resolve these errors and install jdk 1.7?

但是我收到以下错误,我该如何解决这些错误并安装 jdk 1.7?

Any help is highly appreciable.

任何帮助都是非常可观的。

Thanks

谢谢

rpm -ivh /tmp/mnt/jdk-7u9-linux-i586.rpm
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
        rt.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_09/jre/lib/rt.pack
        jsse.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_09/jre/lib/jsse.pack
        charsets.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_09/jre/lib/charsets.pack
        tools.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_09/lib/tools.pack
        localedata.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_09/jre/lib/ext/localedata.pack
        plugin.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_09/jre/lib/plugin.pack
        javaws.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_09/jre/lib/javaws.pack
        deploy.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_09/jre/lib/deploy.pack

My Linux version is oracle linux 5.5

我的 Linux 版本是 oracle linux 5.5

采纳答案by paulsm4

1) I agree with Stephen C - this definitely sounds like "permissions"

1)我同意斯蒂芬 C - 这绝对听起来像“权限”

2) "sudo" - you must definitely run the command as "root"

2)“sudo”——你一定要以“root”身份运行命令

3) Do an ls -ld /usr/java/jdk1.7.0_09/to make sure the directory exists.

3)ls -ld /usr/java/jdk1.7.0_09/确保目录存在。

If it doesn't, consider doing a "mkdir /usr/java" and re-running the command

如果没有,请考虑执行“mkdir /usr/java”并重新运行命令

4) This thread will probably be migrated to "superuser.com", which is more for administrative questions

4)这个帖子可能会迁移到“superuser.com”,更多是针对管理问题

5) If you still don't have a solution, please be sure to specify your Linux version.

5) 如果您仍然没有解决方案,请务必指定您的 Linux 版本。

==================================================================================

================================================== ================================

ADDENDUM:

附录:

The post gave the impression the JDK install failed; it sounded like noneof the RPM was getting extracted.

该帖子给人的印象是 JDK 安装失败;听起来好像没有任何RPM 被提取。

Based on the subsequent information, it sounds like it's merely a warning:

根据随后的信息,这听起来只是一个警告:

In version 7u9, shows the following error messages related to file extension pack, which is used in the facilities of Java applications, using Java Web Start. This does not affect the functionality of the JRE installed on your system, made ??by this binary package format (RPM).

Your install of Sun jdk-7u7-linux-x64.rpm was successful. The error messages displayed, are normal. They exist because those files don't exist in the package. I get them when installing the Sun jre rpm packages. Just ignore those particular error messages.

在版本 7u9 中,显示以下与文件扩展包相关的错误消息,该文件扩展包用于 Java 应用程序的设施中,使用 Java Web Start。这不会影响系统上安装的 JRE 的功能,由这种二进制包格式 (RPM) 制成。

您的 Sun jdk-7u7-linux-x64.rpm 安装成功。显示的错误信息是正常的。它们存在是因为这些文件不存在于包中。我在安装 Sun jre rpm 软件包时得到它们。只需忽略那些特定的错误消息。

回答by Stephen C

You probably need to tun the rpmcommand as root.

您可能需要以rpmroot 身份调整命令。

Another possibility is that SELinux is getting in the way. Do you have SELinux enforcing enabled with the strict policy?

另一种可能性是 SELinux 妨碍了。您是否使用严格的策略启用了 SELinux 强制?