Update check_build_environment in bootstrap

Newer versions of OpenJDK can handle running Narwhal.
It seems the problem is fixed in versions of OpenJDK 6 >= b18.
This commit checks for a sufficiently recent version of
OpenJDK and only prints an error/exits if the OpenJDK
version is older than 6b18.
This commit is contained in:
Paul Baumgart authored and Paul Baumgart committed 2011-01-19 20:26:28 -08:00
1 parent b33b2df778
commit 5d27661354
1 file changed
+9 -8
+9 -8
View File
@@ -79,15 +79,16 @@ function check_and_exit () {
}
function check_build_environment () {
# make sure user is running HotSpot JVM
java -version 2>&1 | grep HotSpot &> /dev/null
if [ ! "$?" = "0" ]; then
java_ver=`java -version 2>&1 | egrep "(Client|Server)"`
if [ "$java_ver" = "" ]; then
java_ver="your JVM"
# make sure user is running the Sun JVM or OpenJDK >= 6b18
java_version=$(java -version 2>&1)
echo $java_version | grep OpenJDK > /dev/null
if [ "$?" = "0" ]; then # OpenJDK: make sure >= 6b18
openjdk_version=$(echo $java_version | egrep -o '[0-9]b[0-9]+')
if [ $(echo $openjdk_version | tr -d 'b') -lt 618 ]; then
echo "Error: Narwhal is not compatible with your version of OpenJDK: $openjdk_version."
echo "Please upgrade to OpenJDK >= 6b18 or switch to the Sun JVM. Then re-run bootstrap.sh."
exit 1
fi
echo "Error: Narwhal is not compatible with $java_ver. Please switch to the Sun (HotSpot) JVM and re-run bootstrap.sh."
exit 1
fi
# make sure other dependencies are installed and on the $PATH