pallet.crate.java documentation

Crates for java installation and configuration.

Sun Java installation on CentOS requires use of Oracle rpm's. Download from http://www.oracle.com/technetwork/java/javase/downloads/index.html and get the .rpm.bin file onto the node with remote-file. Then pass the location of the rpm.bin file on the node using the :rpm-bin option. The rpm will be installed.

download-install

fn

[session settings]

Download and unpack a jdk tar.gz file

install

fn

[{:keys [instance-id]}]

Install java. OpenJDK installs from system packages by default.

jce-policy-file

fn

[filename & {:as options}]

Installs a local JCE policy jar at the given path in the remote JAVA_HOME's lib/security directory, enabling the use of "unlimited strength" crypto implementations. Options are as for remote-file.

e.g. (jce-policy-file "localpolicy.jar" :local-file "path/to/localpolicy.jar")

Note this only intended to work for ubuntu/aptitude-managed systems and Sun JDKs right now.

server-spec

fn

[settings & {:keys [instance-id], :as options}]

Returns a service-spec for installing java.

settings

fn

[{:keys [vendor version components instance-id], :as settings}]

Capture settings for java

  • :vendor one of #{:openjdk :oracle :sun}
  • :components a set of #{:jdk :jre}

  • :package installs from packages

  • :rpm takes a map of remote-file options specifying a self-extracting rpm file to install

  • :debs takes a map of remote-directory options specifying an archive of deb files to install. The archive should have no top level directory.

  • :package-source takes a map of options to package-source. When used with :debs, specifies the local path for the deb files to be expanded to. should specify a :name key.

  • :download takes a map of options to remote-file

The default for openjdk is to install from system packages.

The story for Oracle JDK is way more complicated.

RPM based systems

Download the rpm.bin file, and pass it in the :rpm option.

Apt based systems

Since Oracle don't provide debs, this gets complex.

JDK 6

Build packages using https://github.com/rraptorr/sun-java6, possibly via https://github.com/palletops/java-package-builder. Pass the resulting debs as a tar file to :debs.

JDK 7

Use the webupd8.org ppa. This is the default

http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html