1#!/bin/sh 2# 3# Copyright (C) 2017 and later: Unicode, Inc. and others. 4# License & terms of use: http://www.unicode.org/copyright.html 5# 6# Copyright (c) 2008-2013 IBM Corp. and Others. All Rights Reserved 7VER=/System/Library/Frameworks/JavaVM.framework/Versions 8if [ ! -d "${VER}" ]; 9then 10 echo err, cant find ${VER} - are you really on a mac? 11 exit 1 12fi 13 14VERS=`cd ${VER};ls -d [0-9]*` 15 16for aver in ${VERS}; 17do 18 if [ ! -x ${VER}/${aver}/Home/bin/java ]; then 19 continue 20 fi 21 if ! ${VER}/${aver}/Home/bin/java -version 2> /dev/null; then 22 continue 23 fi 24 VERNUM=`echo "${aver}" | tr '.' '_'` 25 F=${VERNUM}.jvm.sh 26 echo "# ${F} from ${VER}/${aver}" 27 cat > ${F} <<EOF 28JAVA_HOME=${VER}/${aver}/Home 29EOF 30 chmod a+rx ${F} 31 32 if ! ./test.sh ${F}; then 33 rm ${F} 34 echo "# Deleted: ${F} due to failure" 35 fi 36done 37