7

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

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?

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

Jacob
  • 14,463
  • 65
  • 207
  • 320
  • This is not a programming question. In fact, it *looks* like a basic system administration question ... on how to install Java on a Linux machine. – Stephen C Nov 09 '12 at 05:07
  • @StephenC So where to move this question? – Jacob Nov 09 '12 at 05:09
  • superuser.com or serverfault.com, depending on whether you are doing this in a "professional capacity". (It is a somewhat bizarre distinction, IMO ... but that is the way that they play it.) – Stephen C Nov 09 '12 at 05:27

2 Answers2

5

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

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

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

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

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

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

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

ADDENDUM:

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

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.

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • I ran as root and directory /usr/java does exists. – Jacob Nov 09 '12 at 05:13
  • So did you look to see if "/usr/java/jdk1.7.0_09/" existed, too???? If not, did you try a "mkdir /usr/java/jdk1.7.0_09" to see if you had permission to create it??? This is all basic troubleshooting... PS: Exactly what *is* your Linux version? – paulsm4 Nov 09 '12 at 05:16
  • My linux version is oracle linux 5.5. Thanks – Jacob Nov 09 '12 at 05:17
  • usr/java/jdk1.7.0_09 was created when I installed the jdk – Jacob Nov 09 '12 at 05:19
  • Please read my addendum above – paulsm4 Nov 09 '12 at 06:19
  • After installation if try java -version, I am getting `java.lang.Error: Properties init: Could not determine current working directory. at java.lang.System.initProperties(Native Method) at java.lang.System.initializeSystemClass(System.java:1115)` – Jacob Nov 09 '12 at 08:15
  • After installation I did a reboot and that solved the problem. Thanks. – Jacob Nov 09 '12 at 08:39
  • FWIW, I started getting these .pack errors after I aborted an rpm installation and it ended up in a weird unfinished state that even --force couldn't sort out. java wouldn't run because of "java/lang/NoClassDefFoundError: java/lang/Object" What ended up working for me was a full uninstall using instructions on this page http://blog.csdn.net/cnweike/article/details/17005825. Specifically, I was trying to uninstall using `rpm -e` RPM_FILE_NAME as opposed to the correct installed name that `rpm -qa` returns. – Artem Russakovskii Oct 04 '14 at 20:08
2

You probably need to tun the rpm command as root.

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

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216