annotate src/share/bin/launcher.sh-template @ 112:38d07d25ab65

6962318: Update copyright year Reviewed-by: andrew
author ohair
date Wed, 22 Dec 2010 20:12:27 -0800
parents d5ba92698ff5
children
rev   line source
duke@0 1 #!/bin/sh
duke@0 2
duke@0 3 #
ohair@112 4 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
duke@0 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 6 #
duke@0 7 # This code is free software; you can redistribute it and/or modify it
duke@0 8 # under the terms of the GNU General Public License version 2 only, as
ohair@86 9 # published by the Free Software Foundation. Oracle designates this
duke@0 10 # particular file as subject to the "Classpath" exception as provided
ohair@86 11 # by Oracle in the LICENSE file that accompanied this code.
duke@0 12 #
duke@0 13 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 16 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 17 # accompanied this code).
duke@0 18 #
duke@0 19 # You should have received a copy of the GNU General Public License version
duke@0 20 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 22 #
ohair@86 23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@86 24 # or visit www.oracle.com if you need additional information or have any
ohair@86 25 # questions.
duke@0 26 #
duke@0 27
duke@0 28 mydir="`dirname $0`"
duke@0 29 mylib="`dirname $mydir`"/lib
duke@0 30
duke@0 31 # By default, put the jar file and its dependencies on the bootclasspath.
duke@0 32 # This is always required on a Mac, because the system langtools classes
duke@0 33 # are always on the main class path; in addition, it may be required on
duke@0 34 # standard versions of JDK (i.e. using rt.jar and tools.jar) because some
duke@0 35 # langtools interfaces are in rt.jar.
duke@0 36 # Assume that the jar file being invoked lists all the necessary langtools
duke@0 37 # jar files in its Class-Path manifest entry, so there is no need to search
duke@0 38 # dependent jar files for additional dependencies.
duke@0 39
duke@0 40 if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then
jjg@82 41 cp=`unzip -c "$mylib/#PROGRAM#.jar" META-INF/MANIFEST.MF |
duke@0 42 grep "Class-Path:" |
duke@0 43 sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1:|g'`
duke@0 44 bcp="$mylib/#PROGRAM#.jar":$cp
duke@0 45 fi
duke@0 46
jjg@50 47 # tools currently assumes that assertions are enabled in the launcher
jjg@50 48 ea=-ea:com.sun.tools...
duke@0 49
jjg@50 50 # Any parameters starting with -J are passed to the JVM.
jjg@50 51 # All other parameters become parameters of #PROGRAM#.
jjg@50 52
jjg@50 53 # Separate out -J* options for the JVM
jjg@50 54 # Unset IFS and use newline as arg separator to preserve spaces in args
jjg@50 55 DUALCASE=1 # for MKS: make case statement case-sensitive (6709498)
jjg@50 56 saveIFS="$IFS"
jjg@50 57 nl='
jjg@50 58 '
jjg@50 59 for i in "$@" ; do
jjg@50 60 IFS=
jjg@50 61 case $i in
jjg@50 62 -J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
jjg@50 63 * ) toolOpts=$toolOpts$nl$i ;;
jjg@50 64 esac
jjg@50 65 IFS="$saveIFS"
jjg@50 66 done
jjg@50 67 unset DUALCASE
jjg@50 68
jjg@83 69 IFS=$nl
jjg@83 70 "#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mydir}"/../lib/#PROGRAM#.jar ${toolOpts}