mirror of https://github.com/apache/jclouds.git
Issue 891: update to support lucid
This commit is contained in:
parent
f241483913
commit
0105e869c8
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue