Fucking Java

If you happen to suck with Ubuntu on Amazon EC2 because you launched a 32bit micro instance you might want to fix it as advised in https://bugs.launchpad.net/ubuntu/+source/linux-ec2/+bug/634487

ec2-stop-instance ${IID}
ec2-modify-instance-attribute --instance-type m1.small ${IID}
ec2-start-instances ${IID}
ssh -t instance 'sudo dpkg --configure -a'
ec2-stop-instance ${IID}
ec2-modify-instance-attribute --instance-type t1.micro ${IID}
ec2-start-instances ${IID}

I was even upgrading from Lucid to Maverick and to get a newer kernel I practically had to hunt for the right kernel ID. Just for the record, the command to change to the - presumably right - kernel was this:

ec2-modify-instance-attribute --kernel aki-13d5aa41 \
--region ap-southeast-1 i-ce96a99c# aki-de1e608c was the one for Lucid

This article helped the hunt: http://ubuntu-smoser.blogspot.com/2010/04/upgrading-ebs-instance.html

But that's not the end of the story. You might want to turn this machine into your Amazon infrastructure's command-line control-center, by installing the ec2-api-tools package. This depends on Java, so you will be forced to install a Java implementation. It turns out the default Java implementation is OpenJDK which just sucks because any ec2 utilities will throws an error like this:

java.net.SocketException: java.security.NoSuchAlgorithmException:
Error constructing implementation (algorithm: Default, provider: SunJSSE,
class: sun.security.ssl.DefaultSSLContextImpl)

Googling for "Java Ubuntu" we can end up at https://wiki.ubuntu.com/LucidLynx/ReleaseNotes thru https://help.ubuntu.com/community/Java which tells us how to pull the original Sun Java which is a heresy to install on Ubuntu since it has some non-GNU license... Anyway, their advised procedure looks like this:

sudo update-java-alternatives -l
sudo update-java-alternatives -s java-6-sun
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"
sudo apt-get update
sudo apt-get install sun-java6-jre    # or sun-java6-jdk

Summary: It's pathetic... I don't even use Java for anything else at the moment... I really should create a Rebol version of the EC2 tools, precompiled as 1MB executables for the 3 major platforms, just like http://cheyenne-server.org/ does.

2070 views and 1 response

  • Nov 28 2010, 1:40 PM
    ecin responded:
    I second that push. Installing Java just for some command line tools? Clearly there's a better way.