Issue 891: update to support lucid

This commit is contained in:
Adrian Cole 2012-04-03 16:22:02 -07:00
parent 21525f08ab
commit 95b33d335a
5 changed files with 40 additions and 20 deletions

View File

@ -154,18 +154,22 @@ END_OF_JCLOUDS_FILE
function installOpenJDK() { function installOpenJDK() {
if hash apt-get 2>/dev/null; then if hash apt-get 2>/dev/null; then
export pkg=openjdk-7-jdk pkg=openjdk-7-jdk
apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg ) (apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )) &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk-*|grep -v common` export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk*|grep -v common`
# ex. lucid where jdk 7 is not present
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
elif hash yum 2>/dev/null; then elif hash yum 2>/dev/null; then
#TODO: find a jdk7 yum repo #TODO: find a jdk7 yum repo
export pkg=java-1.6.0-openjdk-devel export pkg=java-1.6.0-openjdk-devel
yum --nogpgcheck -y install $pkg yum --nogpgcheck -y install $pkg &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*` export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*`
else else
abort "we only support apt-get and yum right now... please contribute!" abort "we only support apt-get and yum right now... please contribute!"
return 1 return 1
fi fi
test -n "$JAVA_HOME" || abort "JDK installation failed!"
ln -Fs $JAVA_HOME /usr/local/jdk ln -Fs $JAVA_HOME /usr/local/jdk
/usr/local/jdk/bin/java -version || abort "cannot run java" /usr/local/jdk/bin/java -version || abort "cannot run java"
setupJavaHomeInProfile setupJavaHomeInProfile

View File

@ -154,18 +154,22 @@ END_OF_JCLOUDS_FILE
function installOpenJDK() { function installOpenJDK() {
if hash apt-get 2>/dev/null; then if hash apt-get 2>/dev/null; then
export pkg=openjdk-7-jdk pkg=openjdk-7-jdk
apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg ) (apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )) &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk-*|grep -v common` export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk*|grep -v common`
# ex. lucid where jdk 7 is not present
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
elif hash yum 2>/dev/null; then elif hash yum 2>/dev/null; then
#TODO: find a jdk7 yum repo #TODO: find a jdk7 yum repo
export pkg=java-1.6.0-openjdk-devel export pkg=java-1.6.0-openjdk-devel
yum --nogpgcheck -y install $pkg yum --nogpgcheck -y install $pkg &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*` export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*`
else else
abort "we only support apt-get and yum right now... please contribute!" abort "we only support apt-get and yum right now... please contribute!"
return 1 return 1
fi fi
test -n "$JAVA_HOME" || abort "JDK installation failed!"
ln -Fs $JAVA_HOME /usr/local/jdk ln -Fs $JAVA_HOME /usr/local/jdk
/usr/local/jdk/bin/java -version || abort "cannot run java" /usr/local/jdk/bin/java -version || abort "cannot run java"
setupJavaHomeInProfile setupJavaHomeInProfile

View File

@ -154,18 +154,22 @@ END_OF_JCLOUDS_FILE
function installOpenJDK() { function installOpenJDK() {
if hash apt-get 2>/dev/null; then if hash apt-get 2>/dev/null; then
export pkg=openjdk-7-jdk pkg=openjdk-7-jdk
apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg ) (apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )) &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk-*|grep -v common` export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk*|grep -v common`
# ex. lucid where jdk 7 is not present
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
elif hash yum 2>/dev/null; then elif hash yum 2>/dev/null; then
#TODO: find a jdk7 yum repo #TODO: find a jdk7 yum repo
export pkg=java-1.6.0-openjdk-devel export pkg=java-1.6.0-openjdk-devel
yum --nogpgcheck -y install $pkg yum --nogpgcheck -y install $pkg &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*` export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*`
else else
abort "we only support apt-get and yum right now... please contribute!" abort "we only support apt-get and yum right now... please contribute!"
return 1 return 1
fi fi
test -n "$JAVA_HOME" || abort "JDK installation failed!"
ln -Fs $JAVA_HOME /usr/local/jdk ln -Fs $JAVA_HOME /usr/local/jdk
/usr/local/jdk/bin/java -version || abort "cannot run java" /usr/local/jdk/bin/java -version || abort "cannot run java"
setupJavaHomeInProfile setupJavaHomeInProfile

View File

@ -19,18 +19,22 @@ END_OF_JCLOUDS_FILE
function installOpenJDK() { function installOpenJDK() {
if hash apt-get 2>/dev/null; then if hash apt-get 2>/dev/null; then
export pkg=openjdk-7-jdk pkg=openjdk-7-jdk
apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg ) (apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )) &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk-*|grep -v common` export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk*|grep -v common`
# ex. lucid where jdk 7 is not present
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
elif hash yum 2>/dev/null; then elif hash yum 2>/dev/null; then
#TODO: find a jdk7 yum repo #TODO: find a jdk7 yum repo
export pkg=java-1.6.0-openjdk-devel export pkg=java-1.6.0-openjdk-devel
yum --nogpgcheck -y install $pkg yum --nogpgcheck -y install $pkg &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*` export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*`
else else
abort "we only support apt-get and yum right now... please contribute!" abort "we only support apt-get and yum right now... please contribute!"
return 1 return 1
fi fi
test -n "$JAVA_HOME" || abort "JDK installation failed!"
ln -Fs $JAVA_HOME /usr/local/jdk ln -Fs $JAVA_HOME /usr/local/jdk
/usr/local/jdk/bin/java -version || abort "cannot run java" /usr/local/jdk/bin/java -version || abort "cannot run java"
setupJavaHomeInProfile setupJavaHomeInProfile

View File

@ -154,18 +154,22 @@ END_OF_JCLOUDS_FILE
function installOpenJDK() { function installOpenJDK() {
if hash apt-get 2>/dev/null; then if hash apt-get 2>/dev/null; then
export pkg=openjdk-7-jdk pkg=openjdk-7-jdk
apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg ) (apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )) &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk-*|grep -v common` export JAVA_HOME=`ls -d /usr/lib/jvm/java-7-openjdk*|grep -v common`
# ex. lucid where jdk 7 is not present
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
elif hash yum 2>/dev/null; then elif hash yum 2>/dev/null; then
#TODO: find a jdk7 yum repo #TODO: find a jdk7 yum repo
export pkg=java-1.6.0-openjdk-devel export pkg=java-1.6.0-openjdk-devel
yum --nogpgcheck -y install $pkg yum --nogpgcheck -y install $pkg &&
export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*` export JAVA_HOME=`ls -d /usr/lib/jvm/java-1.6.0-openjdk-*`
else else
abort "we only support apt-get and yum right now... please contribute!" abort "we only support apt-get and yum right now... please contribute!"
return 1 return 1
fi fi
test -n "$JAVA_HOME" || abort "JDK installation failed!"
ln -Fs $JAVA_HOME /usr/local/jdk ln -Fs $JAVA_HOME /usr/local/jdk
/usr/local/jdk/bin/java -version || abort "cannot run java" /usr/local/jdk/bin/java -version || abort "cannot run java"
setupJavaHomeInProfile setupJavaHomeInProfile