Skip to content

Commit 05e4512

Browse files
author
jtimberman
committed
java v1.4.0
1 parent cf960ba commit 05e4512

File tree

2 files changed

+58
-40
lines changed

2 files changed

+58
-40
lines changed

README.md

+56-38
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,59 @@
11
Description
22
===========
33

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

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

10-
---
10+
The `java_ark` LWPR may move to its own cookbook at some point in the
11+
future as its functionality is useful for other purposes.
12+
1113
Requirements
1214
============
1315

1416
Platform
1517
--------
1618

1719
* Debian, Ubuntu
18-
* CentOS, Red Hat, Fedora
19-
20-
Cookbooks
21-
---------
22-
23-
* java
20+
* CentOS, Red Hat, Fedora, Scientific, Amazon
21+
* ArchLinux
22+
* FreeBSD
2423

25-
---
2624
Attributes
2725
==========
2826

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

34-
---
3537
Recipes
3638
=======
3739

3840
default
3941
-------
4042

41-
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.
43+
Include the default recipe in a run list, to get `java`. By default
44+
the `openjdk` flavor of Java is installed, but this can be changed by
45+
using the `install_flavor` attribute.
46+
47+
OpenJDK is the default because of licensing changes made upstream by
48+
Oracle. See notes on the `oracle` recipe below.
4249

4350
openjdk
4451
-------
4552

4653
This recipe installs the `openjdk` flavor of Java.
4754

4855
oracle
49-
---
56+
------
5057

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

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

6371
oracle_i386
6472
-----------
6573

66-
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.
74+
This recipe installs the 32-bit Java virtual machine without setting
75+
it as the default. This can be useful if you have applications on the
76+
same machine that require different versions of the JVM.
6777

6878
Resources/Providers
6979
===================
7080

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

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

79-
By default, the extracted directory is extracted to app_root/extracted_dir_name and symlinked to app_root/default
91+
By default, the extracted directory is extracted to
92+
`app_root/extracted_dir_name` and symlinked to `app_root/default`
8093

8194
# Actions
8295

83-
- :install: extracts the tarball and makes necessary symlinks
84-
- :remove: removes the tarball and run update-alternatives for all
85-
symlinked bin_cmds
96+
- `:install`: extracts the tarball and makes necessary symlinks
97+
- `:remove`: removes the tarball and run update-alternatives for all
98+
symlinked `bin_cmds`
8699

87100
# Attribute Parameters
88101

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

107120

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

128-
129-
130-
---
131141
Usage
132142
=====
133143

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

159+
Changes
160+
=======
161+
162+
## v1.4.0:
149163

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

151169
License and Author
152170
==================
153171

154172
Author:: Seth Chisamore (<[email protected]>)
155173
Author:: Bryan W. Berry (<[email protected]>)
156174

157-
Copyright:: 2008-2011, Opscode, Inc
175+
Copyright:: 2008-2012, Opscode, Inc
158176

159177
Licensed under the Apache License, Version 2.0 (the "License");
160178
you may not use this file except in compliance with the License.

metadata.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
license "Apache 2.0"
44
description "Installs Java runtime."
55
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6-
version "1.3.1"
6+
version "1.4.0"
77

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

1313

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

0 commit comments

Comments
 (0)