Commit 0c01a920 authored by Marcus Nordenberg's avatar Marcus Nordenberg

pwrp_profile: Updated how java is found on debian based systems

parent c3200ed1
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Raspbian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Raspbian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk=""
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Raspbian should have a default-java # If no local jdk/jres were found check for openjdk. Debian can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk=""
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java # If no local jdk/jres were found check for openjdk. Ubuntu can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java # If no local jdk/jres were found check for openjdk. Ubuntu can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java # If no local jdk/jres were found check for openjdk. Ubuntu can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java # If no local jdk/jres were found check for openjdk. Ubuntu can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java # If no local jdk/jres were found check for openjdk. Ubuntu can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1` ...@@ -38,14 +38,19 @@ jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java # If no local jdk/jres were found check for openjdk. Ubuntu can have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk # symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use # is in use. If no default-java excists try to use the one with the highest version
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else else
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
fi
if [ ! -z "$jdk" ]; then
export jdk=$jdk export jdk=$jdk
export JAVA_HOME=$jdk export JAVA_HOME=$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment