Skip to content

Commit

Permalink
java v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Feb 15, 2012
1 parent cf960ba commit 05e4512
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 40 deletions.
94 changes: 56 additions & 38 deletions README.md
@@ -1,52 +1,59 @@
Description
===========

Installs a Java. Uses Oracle's JDK by default but supports installation of the OpenJDK.
Installs a Java. Uses OpenJDK by default but supports installation of Oracle's JDK.

This cookbook also provides the java_ark LWRP which other java
This cookbook also provides the `java_ark` LWRP which other java
cookbooks can use to install java-related applications from binary
packages.

---
The `java_ark` LWPR may move to its own cookbook at some point in the
future as its functionality is useful for other purposes.

Requirements
============

Platform
--------

* Debian, Ubuntu
* CentOS, Red Hat, Fedora

Cookbooks
---------

* java
* CentOS, Red Hat, Fedora, Scientific, Amazon
* ArchLinux
* FreeBSD

---
Attributes
==========

* `node["java"]["install_flavor"]` - Flavor of JVM you would like installed (`oracle` or `openjdk`), default `oracle`.
* `node['java']['java_home']`
See `attributes/default.rb` for default values.

* `node["java"]["install_flavor"]` - Flavor of JVM you would like installed (`oracle` or `openjdk`), default `openjdk`.
* `node['java']['java_home']` - Default location of the "`$JAVA_HOME`".
* `node['java']['tarball']` - name of the tarball to retrieve from your corporate repository default `jdk1.6.0_29_i386.tar.gz`
* `node['java']['tarball_checksum']` - checksum for the tarball, if you use a different tarball, you also need to create a new sha256 checksum
* `node['java']['jdk']` - version and architecture specific attributes
for setting the URL on Oracle's site for the JDK, and the checksum
of the .tar.gz.

---
Recipes
=======

default
-------

Include the default recipe in a run list, to get `java`. By default the `oracle` flavor of Java is installed, but this can be changed by using the `install_flavor` attribute.
Include the default recipe in a run list, to get `java`. By default
the `openjdk` flavor of Java is installed, but this can be changed by
using the `install_flavor` attribute.

OpenJDK is the default because of licensing changes made upstream by
Oracle. See notes on the `oracle` recipe below.

openjdk
-------

This recipe installs the `openjdk` flavor of Java.

oracle
---
------

This recipe installs the `oracle` flavor of Java. This recipe does not
use distribution packages as Oracle changed the licensing terms with
Expand All @@ -58,50 +65,56 @@ JAVA_HOME for each distribution. For debian/ubuntu, this is
/usr/lib/jvm/default-java. For Centos/RHEL, this is /usr/lib/jvm/java

After putting the binaries in place, the oracle recipe updates
/usr/bin/java to point to the installed JDK using the update-alternatives script
/usr/bin/java to point to the installed JDK using the
`update-alternatives` script

oracle_i386
-----------

This recipe installs the 32-bit Java virtual machine without setting it as the default. This can be useful if you have applications on the same machine that require different versions of the JVM.
This recipe installs the 32-bit Java virtual machine without setting
it as the default. This can be useful if you have applications on the
same machine that require different versions of the JVM.

Resources/Providers
===================

This LWRP provides an easy way to manage java applications. It uses
the LWRP arkive (deliberately misspelled). It is an arkive and not an
"archive" because the java_ark lwrp is not the same as a java archive
or "jar". Essentially, you provide the java_ark with the URL to a tarball and
the commands within the extracted result that you want symlinked to /usr/bin/
"archive" because the `java_ark` lwrp is not the same as a java
archive or "jar". Essentially, you provide the `java_ark` with the URL
to a tarball and the commands within the extracted result that you
want symlinked to /usr/bin/

If you have a better name for this lwrp please contact the maintainer.
The `java_ark` LWPR may move to its own cookbook at some point in the
future as its functionality is useful for other purposes.

By default, the extracted directory is extracted to app_root/extracted_dir_name and symlinked to app_root/default
By default, the extracted directory is extracted to
`app_root/extracted_dir_name` and symlinked to `app_root/default`

# Actions

- :install: extracts the tarball and makes necessary symlinks
- :remove: removes the tarball and run update-alternatives for all
symlinked bin_cmds
- `:install`: extracts the tarball and makes necessary symlinks
- `:remove`: removes the tarball and run update-alternatives for all
symlinked `bin_cmds`

# Attribute Parameters

- url: path to tarball, .tar.gz, .bin (oracle-specific), and .zip
- `url`: path to tarball, .tar.gz, .bin (oracle-specific), and .zip
currently supported
- checksum: sha256 checksum, not used for security but avoid
- `checksum`: sha256 checksum, not used for security but avoid
redownloading the archive on each chef-client run
- app_home: the default for installations of this type of
application, for example, /usr/lib/tomcat/default. If your
- `app_home`: the default for installations of this type of
application, for example, `/usr/lib/tomcat/default`. If your
application is not set to the default, it will be placed at the same
level in the directory hierarchy but the directory name will be
app_root/extracted_directory_name + "_alt"
- app_home_mode: file mode for app_home, is an integer
- bin_cmds: array of binary commands that should be symlinked to
`app_root/extracted_directory_name + "_alt"`
- `app_home_mode`: file mode for app_home, is an integer
- `bin_cmds`: array of binary commands that should be symlinked to
/usr/bin, examples are mvn, java, javac, etc. These cmds must be in
the bin/ subdirectory of the extracted folder. Will be ignored if this
java_ark is not the default
- owner: owner of extracted directory, set to "root" by default
- default: whether this the default installation of this package,
- `owner`: owner of extracted directory, set to "root" by default
- `default`: whether this the default installation of this package,
boolean true or false


Expand All @@ -125,9 +138,6 @@ By default, the extracted directory is extracted to app_root/extracted_dir_name
action :install
end



---
Usage
=====

Expand All @@ -146,15 +156,23 @@ To install Oracle flavored Java on Debian or Ubuntu override the `node['java']['
"recipe[java]"
)

Changes
=======

## v1.4.0:

* [COOK-858] - numerous updates: handle jdk6 and 7, switch from sun to
oracle, make openjdk default, add `java_ark` LWRP.
* [COOK-942] - FreeBSD support
* [COOK-520] - ArchLinux support

License and Author
==================

Author:: Seth Chisamore (<schisamo@opscode.com>)
Author:: Bryan W. Berry (<bryan.berry@gmail.com>)

Copyright:: 2008-2011, Opscode, Inc
Copyright:: 2008-2012, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions metadata.rb
Expand Up @@ -3,14 +3,14 @@
license "Apache 2.0"
description "Installs Java runtime."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.3.1"
version "1.4.0"

recipe "java", "Installs Java runtime"
recipe "java::openjdk", "Installs the OpenJDK flavor of Java"
recipe "java::oracle", "Installs the Oracle flavor of Java"
recipe "java::oracle_i386", "Installs the 32-bit jvm without setting it as the default"


%w{ debian ubuntu centos redhat fedora arch freebsd }.each do |os|
%w{ debian ubuntu centos redhat scientific fedora amazon arch freebsd }.each do |os|
supports os
end

0 comments on commit 05e4512

Please sign in to comment.