duke@1: #!/bin/sh duke@1: duke@1: # ohair@554: # Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. duke@1: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: # duke@1: # This code is free software; you can redistribute it and/or modify it duke@1: # under the terms of the GNU General Public License version 2 only, as ohair@554: # published by the Free Software Foundation. Oracle designates this duke@1: # particular file as subject to the "Classpath" exception as provided ohair@554: # by Oracle in the LICENSE file that accompanied this code. duke@1: # duke@1: # This code is distributed in the hope that it will be useful, but WITHOUT duke@1: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: # version 2 for more details (a copy is included in the LICENSE file that duke@1: # accompanied this code). duke@1: # duke@1: # You should have received a copy of the GNU General Public License version duke@1: # 2 along with this work; if not, write to the Free Software Foundation, duke@1: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: # ohair@554: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: # or visit www.oracle.com if you need additional information or have any ohair@554: # questions. duke@1: # duke@1: duke@1: mydir="`dirname $0`" duke@1: mylib="`dirname $mydir`"/lib duke@1: duke@1: # By default, put the jar file and its dependencies on the bootclasspath. duke@1: # This is always required on a Mac, because the system langtools classes duke@1: # are always on the main class path; in addition, it may be required on duke@1: # standard versions of JDK (i.e. using rt.jar and tools.jar) because some duke@1: # langtools interfaces are in rt.jar. duke@1: # Assume that the jar file being invoked lists all the necessary langtools duke@1: # jar files in its Class-Path manifest entry, so there is no need to search duke@1: # dependent jar files for additional dependencies. duke@1: duke@1: if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then jjg@471: cp=`unzip -c "$mylib/#PROGRAM#.jar" META-INF/MANIFEST.MF | duke@1: grep "Class-Path:" | duke@1: sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1:|g'` duke@1: bcp="$mylib/#PROGRAM#.jar":$cp duke@1: fi duke@1: jjg@308: # tools currently assumes that assertions are enabled in the launcher jjg@370: ea=-ea:com.sun.tools... duke@1: jjg@308: # Any parameters starting with -J are passed to the JVM. jjg@308: # All other parameters become parameters of #PROGRAM#. jjg@308: jjg@308: # Separate out -J* options for the JVM jjg@308: # Unset IFS and use newline as arg separator to preserve spaces in args jjg@308: DUALCASE=1 # for MKS: make case statement case-sensitive (6709498) jjg@308: saveIFS="$IFS" jjg@308: nl=' jjg@308: ' jjg@308: for i in "$@" ; do jjg@308: IFS= jjg@308: case $i in jjg@308: -J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;; jjg@308: * ) toolOpts=$toolOpts$nl$i ;; jjg@308: esac jjg@308: IFS="$saveIFS" jjg@308: done jjg@308: unset DUALCASE jjg@308: jjg@548: IFS=$nl jjg@548: "#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mydir}"/../lib/#PROGRAM#.jar ${toolOpts}