JAVA_HOME, sun vs. openjdk inconsistencies


#1

Hi,

The “java” cookbook now installs OpenJDK instead of Sun’s JDK.

However, other cookbooks which use Java (JIRA, Tomcat) currently use
an incorrect or inconsistent Java home - some hardcoded to the Sun
path (e.g. /usr/lib/jvm/java-6-sun in the case of JIRA), or
/usr/lib/jvm/java in the case of Tomcat.

Also, the tomcat package has the dependency on the java recipe commented.

The result is that these cookbooks don’t work “out of the box”.

What’s the right way to resolve this?

In my opinion, the best thing would be to keep a symlink at
/usr/lib/jvm/java which points to the current java home. I’m not sure
if this should be a change in chef or the openjdk packages…

Thoughts?

Thanks,
– Chad


#2

On Tue, Jun 1, 2010 at 12:24 AM, Chad Woolley thewoolleyman@gmail.com wrote:

Hi,

The “java” cookbook now installs OpenJDK instead of Sun’s JDK.

Also, Tomcat doesn’t even work with OpenJDK6:

java.lang.ClassNotFoundException: sun/management/snmp/AdaptorBootstrap

Looks like they are adding this in OpenJDK7, but for now Tomcat is
broken with the default ‘java’ recipe.

What drove the switch to OpenJDK over Sun now? Why not wait until it
is actually removed? Or even better, have cookbooks for both versions
in the repo?

Thanks,
– Chad


#3

I certainly have a personal preference for the Sun JDK, myself.

Adam

On Tue, Jun 1, 2010 at 2:22 AM, Chad Woolley thewoolleyman@gmail.com wrote:

On Tue, Jun 1, 2010 at 12:24 AM, Chad Woolley thewoolleyman@gmail.com wrote:

Hi,

The “java” cookbook now installs OpenJDK instead of Sun’s JDK.

Also, Tomcat doesn’t even work with OpenJDK6:

java.lang.ClassNotFoundException: sun/management/snmp/AdaptorBootstrap

Looks like they are adding this in OpenJDK7, but for now Tomcat is
broken with the default ‘java’ recipe.

What drove the switch to OpenJDK over Sun now? Why not wait until it
is actually removed? Or even better, have cookbooks for both versions
in the repo?

Thanks,
– Chad


Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com


#4

On Tue, Jun 1, 2010 at 2:22 AM, Chad Woolley thewoolleyman@gmail.com wrote:

What drove the switch to OpenJDK over Sun now? Why not wait until it
is actually removed? Or even better, have cookbooks for both versions
in the repo?

I can’t check this myself right now, but I suspect that this is more
an Ubuntu move and that the cookbook will need to be specifically
modified for Lucid and beyond.

https://wiki.ubuntu.com/LucidLynx/ReleaseNotes#Sun%20Java%20moved%20to%20the%20Partner%20repository


#5

Is there any reason there can’t be both? I already copied the sun
version from the history to a “java_sun” cookbook . Would you like me
to contribute it in a patch?

On Tuesday, June 1, 2010, Adam Jacob adam@opscode.com wrote:

I certainly have a personal preference for the Sun JDK, myself.

Adam

On Tue, Jun 1, 2010 at 2:22 AM, Chad Woolley thewoolleyman@gmail.com wrote:

On Tue, Jun 1, 2010 at 12:24 AM, Chad Woolley thewoolleyman@gmail.com wrote:

Hi,

The “java” cookbook now installs OpenJDK instead of Sun’s JDK.

Also, Tomcat doesn’t even work with OpenJDK6:

java.lang.ClassNotFoundException: sun/management/snmp/AdaptorBootstrap

Looks like they are adding this in OpenJDK7, but for now Tomcat is
broken with the default ‘java’ recipe.

What drove the switch to OpenJDK over Sun now? Why not wait until it
is actually removed? Or even better, have cookbooks for both versions
in the repo?

Thanks,
– Chad


Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com


#6

Hi Chad!

I made the change to openjdk because the Sun java package is
considered deprecated (though still available) in both Debian and
Ubuntu. To support installing Sun’s package where it is available, we
should utilize either a separate recipe in the kava cookbook, or
control the preferred package via an attribute. The default should be
openjdk, as it’s the default on all of Devian, Ubuntu and RHEL/Centos.

Please open a ticket in the cookbook project. If you have a patch,
please link to the github branch.

Thank you!

On Jun 1, 2010, at 3:35 PM, Chad Woolley thewoolleyman@gmail.com
wrote:

Is there any reason there can’t be both? I already copied the sun
version from the history to a “java_sun” cookbook . Would you like me
to contribute it in a patch?

On Tuesday, June 1, 2010, Adam Jacob adam@opscode.com wrote:

I certainly have a personal preference for the Sun JDK, myself.

Adam

On Tue, Jun 1, 2010 at 2:22 AM, Chad Woolley
thewoolleyman@gmail.com wrote:

On Tue, Jun 1, 2010 at 12:24 AM, Chad Woolley <thewoolleyman@gmail.com

wrote:
Hi,

The “java” cookbook now installs OpenJDK instead of Sun’s JDK.

Also, Tomcat doesn’t even work with OpenJDK6:

java.lang.ClassNotFoundException: sun/management/snmp/
AdaptorBootstrap

Looks like they are adding this in OpenJDK7, but for now Tomcat is
broken with the default ‘java’ recipe.

What drove the switch to OpenJDK over Sun now? Why not wait until
it
is actually removed? Or even better, have cookbooks for both
versions
in the repo?

Thanks,
– Chad


Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com


#7

On Tue, Jun 1, 2010 at 4:00 PM, Joshua Timberman joshua@opscode.com wrote:

Hi Chad!

I made the change to openjdk because the Sun java package is considered
deprecated (though still available) in both Debian and Ubuntu. To support
installing Sun’s package where it is available, we should utilize either a
separate recipe in the kava cookbook, or control the preferred package via
an attribute. The default should be openjdk, as it’s the default on all of
Devian, Ubuntu and RHEL/Centos.

Please open a ticket in the cookbook project. If you have a patch, please
link to the github branch.

Thanks, I’ll do so.

What is the “kava cookbook”? Google and search on opscode wiki turned
up nothing.


#8

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

On Jun 1, 2010, at 7:17 PM, Chad Woolley wrote:

What is the “kava cookbook”? Google and search on opscode wiki turned
up nothing.

iPhone autocorrect, of course. Apparently “java” was not a known word.


Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: joshua@opscode.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkwFpncACgkQO97WSdVpzT2LMACbBc+DBUJPvEXnKsrByVlza7f/
NeQAn3UojI59J0j3fosGM9qXV4rBzo2a
=Vd2F
-----END PGP SIGNATURE-----


#9

On Tue, Jun 1, 2010 at 4:00 PM, Joshua Timberman joshua@opscode.com wrote:

Hi Chad!

I made the change to openjdk because the Sun java package is considered
deprecated (though still available) in both Debian and Ubuntu. To support
installing Sun’s package where it is available, we should utilize either a
separate recipe in the kava cookbook, or control the preferred package via
an attribute. The default should be openjdk, as it’s the default on all of
Devian, Ubuntu and RHEL/Centos.

Please open a ticket in the cookbook project. If you have a patch, please
link to the github branch.

Pull request sent
(http://github.com/thewoolleyman/cookbooks/tree/COOK-312). I made a
separate cookbook, java_sun. This seemed cleaner than grafting it
back into the main java cookbook as a separate recipe, especially
since I didn’t know what to do with ‘supports os’ in metadata.rb if a
single recipe only supports certain platforms…