1#!/bin/sh 2# Copyright 2008, The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16# Set up prog to be the path of this script, including following symlinks, 17# and set up progdir to be the fully-qualified pathname of its directory. 18 19prog="$0" 20while [ -h "${prog}" ]; do 21 newProg=`/bin/ls -ld "${prog}"` 22 newProg=`expr "${newProg}" : ".* -> \(.*\)$"` 23 if expr "x${newProg}" : 'x/' >/dev/null; then 24 prog="${newProg}" 25 else 26 progdir=`dirname "${prog}"` 27 prog="${progdir}/${newProg}" 28 fi 29done 30oldwd=`pwd` 31progdir=`dirname "${prog}"` 32cd "${progdir}" 33progdir=`pwd` 34prog="${progdir}"/`basename "${prog}"` 35cd "${oldwd}" 36 37jarfile=jobb.jar 38frameworkdir="$progdir" 39libdir="$progdir" 40if [ ! -r "$frameworkdir/$jarfile" ] 41then 42 frameworkdir=`dirname "$progdir"`/tools/lib 43 libdir=`dirname "$progdir"`/tools/lib 44fi 45if [ ! -r "$frameworkdir/$jarfile" ] 46then 47 frameworkdir=`dirname "$progdir"`/framework 48 libdir=`dirname "$progdir"`/lib 49fi 50if [ ! -r "$frameworkdir/$jarfile" ] 51then 52 echo `basename "$prog"`": can't find $jarfile" 53 exit 1 54fi 55 56javaCmd="java" 57 58if [ `uname` = "Linux" ]; then 59 export GDK_NATIVE_WINDOWS=true 60fi 61 62jarpath="$frameworkdir/$jarfile:$frameworkdir/fat32lib.jar" 63 64exec "$javaCmd" \ 65 $os_opts \ 66 -classpath "$jarpath" \ 67 com.android.jobb.Main "$@" 68 69