1*1789df15SXin Li@echo off 2*1789df15SXin Lirem Copyright (C) 2008 The Android Open Source Project 3*1789df15SXin Lirem 4*1789df15SXin Lirem Licensed under the Apache License, Version 2.0 (the "License"); 5*1789df15SXin Lirem you may not use this file except in compliance with the License. 6*1789df15SXin Lirem You may obtain a copy of the License at 7*1789df15SXin Lirem 8*1789df15SXin Lirem http://www.apache.org/licenses/LICENSE-2.0 9*1789df15SXin Lirem 10*1789df15SXin Lirem Unless required by applicable law or agreed to in writing, software 11*1789df15SXin Lirem distributed under the License is distributed on an "AS IS" BASIS, 12*1789df15SXin Lirem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*1789df15SXin Lirem See the License for the specific language governing permissions and 14*1789df15SXin Lirem limitations under the License. 15*1789df15SXin Li 16*1789df15SXin Lirem don't modify the caller's environment 17*1789df15SXin Lisetlocal 18*1789df15SXin Li 19*1789df15SXin Lirem Set up prog to be the path of this script, including following symlinks, 20*1789df15SXin Lirem and set up progdir to be the fully-qualified pathname of its directory. 21*1789df15SXin Liset prog=%~f0 22*1789df15SXin Li 23*1789df15SXin Lirem Change current directory and drive to where the script is, to avoid 24*1789df15SXin Lirem issues with directories containing whitespaces. 25*1789df15SXin Licd /d %~dp0 26*1789df15SXin Li 27*1789df15SXin Lirem Check we have a valid Java.exe in the path. 28*1789df15SXin Liset java_exe= 29*1789df15SXin Licall lib\find_java.bat 30*1789df15SXin Liif not defined java_exe goto :EOF 31*1789df15SXin Li 32*1789df15SXin Liset jarfile=hierarchyviewer.jar 33*1789df15SXin Liset frameworkdir=. 34*1789df15SXin Liset libdir= 35*1789df15SXin Li 36*1789df15SXin Liif exist %frameworkdir%\%jarfile% goto JarFileOk 37*1789df15SXin Li set frameworkdir=lib 38*1789df15SXin Li 39*1789df15SXin Liif exist %frameworkdir%\%jarfile% goto JarFileOk 40*1789df15SXin Li set frameworkdir=..\framework 41*1789df15SXin Li 42*1789df15SXin Li:JarFileOk 43*1789df15SXin Li 44*1789df15SXin Liset jarpath=%frameworkdir%\%jarfile% 45*1789df15SXin Li 46*1789df15SXin Licall "%java_exe%" -Xmx512m "-Djava.ext.dirs=%frameworkdir%" -Dhierarchyviewer.adb= -jar %jarpath% %* 47