When I last followed the instructions for creating a private cloud, the vcap_dev_setup script completed without errors. Today when I tried it I got an error:
Chef::Exceptions::Package: No version specified, and no candidate version available for sun-java6-bin
The package is required in dev_setup/cookbooks/java/recipes/default.rb:
bash "Setup java" do code <<-EOH add-apt-repository "deb http://archive.canonical.com/ lucid partner" apt-get -qqy update echo sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true | /usr/bin/debconf-set-selections echo sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true | /usr/bin/debconf-set-selections EOH not_if do ::File.exists?("/usr/bin/java") end end
%w[ curl sun-java6-bin sun-java6-jre sun-java6-jdk].each do |pkg| package pkg do not_if do ::File.exists?("/usr/bin/java") end end end
It seems that on 2012-02-17 this package was deleted from the lucid partner repository, so the above script no longer works. The explanation is that “Oracle (Sun) Java 6 is no longer available to be distributed by Ubuntu, because of license issues.”
Note that the above code will not attempt to install Java if it is already present, so the error can be avoided by installing Java before starting the vcap_dev_setup script. One approach, suggested at superuser.com, is to get the packages from another repository:
sudo apt-get install python-software-properties sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
You will be required to accept the license. After it finishes, you can confirm that this does indeed install things:
dpkg --get-selections | grep java
Also you can see that the executable exists:
ll /usr/bin/java
There certainly are other ways to add Java to Ubuntu and I don’t suggest that this is the best way–only that it worked for me and now the vcap_dev_setup script completes successfully!
5 comments
Comments feed for this article
February 21, 2012 at 2:02 pm
Philip
Thank You
February 21, 2012 at 9:57 pm
Video: Creating a Private Cloud « Programming Gems (on GemStone)
[…] a new virtual machine in VMware Fusion with Ubuntu 10.04, add a few necessary packages (including Java!), then install Cloud Foundry. Then from the client we “push” a trivial Ruby Sinatra […]
March 8, 2012 at 8:35 am
Remon Oldenbeuving
Thank you!
March 12, 2012 at 1:35 pm
Clay
Tried running;
sudo add-apt-repository ppa:ferramroberto/java
and got the following;
Traceback (most recent call last):
File “/usr/bin/add-apt-repository”, line 88, in
ppa_info = get_ppa_info_from_lp(user, ppa_name)
File “/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py”, line 80, in get_ppa_info_from_lp
curl.perform()
pycurl.error: (7, “couldn’t connect to host”)
March 12, 2012 at 2:12 pm
James Foster
I’m getting a similar error right now. As an alternative, I’d suggest you try the following:
sudo apt-get install openjdk-6-jdk