Use FPM to create java jdk RPM package


Creating packages from redhat or debian systems can be a royal pain. FPM takes some of the pain away. Refer to the FPM wiki for install and usage instructions.

To create an RPM for Oracle’s (sun) java jdk 7:

  1. Download jdk7 from Oracle site. (example, jdk1.7.0_65)
  2. untar into /opt folder, (result: /opt/jdk1.7.0_65)
  3. create script in the exploded folder
  4. create script in the same location
  5. run fpm command
  6. (recommended) upload rpm to your custom yum repo
alternatives --install /usr/bin/java java /opt/jdk1.7.0_65/bin/java 1
alternatives --remove java /opt/jdk1.7.0_65/bin/java
rm -rf /opt/jdk1.7.0_65

Run the fpm command to generate an rpm
fpm -s dir -t rpm --after-install /opt/jdk1.7.0_65/ --after-remove /opt/jdk1.7.0_65/ --name jdk7 -v /opt/jdk1.7.0_65

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Spam Blocker