1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/bin/launcher.sh-template Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,75 @@ 1.4 +#!/bin/sh 1.5 + 1.6 +# 1.7 +# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. 1.8 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.9 +# 1.10 +# This code is free software; you can redistribute it and/or modify it 1.11 +# under the terms of the GNU General Public License version 2 only, as 1.12 +# published by the Free Software Foundation. Oracle designates this 1.13 +# particular file as subject to the "Classpath" exception as provided 1.14 +# by Oracle in the LICENSE file that accompanied this code. 1.15 +# 1.16 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.17 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.18 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.19 +# version 2 for more details (a copy is included in the LICENSE file that 1.20 +# accompanied this code). 1.21 +# 1.22 +# You should have received a copy of the GNU General Public License version 1.23 +# 2 along with this work; if not, write to the Free Software Foundation, 1.24 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.25 +# 1.26 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.27 +# or visit www.oracle.com if you need additional information or have any 1.28 +# questions. 1.29 +# 1.30 + 1.31 +mydir="`dirname $0`" 1.32 +case `uname -s` in 1.33 + CYGWIN*) 1.34 + mydir=`cygpath -m $mydir` 1.35 + ;; 1.36 +esac 1.37 +mylib="$mydir/../lib" 1.38 + 1.39 +# By default, put the jar file and its dependencies on the bootclasspath. 1.40 +# This is always required on a Mac, because the system langtools classes 1.41 +# are always on the main class path; in addition, it may be required on 1.42 +# standard versions of JDK (i.e. using rt.jar and tools.jar) because some 1.43 +# langtools interfaces are in rt.jar. 1.44 +# Assume that the jar file being invoked lists all the necessary langtools 1.45 +# jar files in its Class-Path manifest entry, so there is no need to search 1.46 +# dependent jar files for additional dependencies. 1.47 + 1.48 +if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then 1.49 + cp=`unzip -c "$mylib/#PROGRAM#.jar" META-INF/MANIFEST.MF | 1.50 + grep "Class-Path:" | 1.51 + sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1#PS#|g'` 1.52 + bcp="$mylib/#PROGRAM#.jar#PS#$cp" 1.53 +fi 1.54 + 1.55 +# tools currently assumes that assertions are enabled in the launcher 1.56 +ea=-ea:com.sun.tools... 1.57 + 1.58 +# Any parameters starting with -J are passed to the JVM. 1.59 +# All other parameters become parameters of #PROGRAM#. 1.60 + 1.61 +# Separate out -J* options for the JVM 1.62 +# Unset IFS and use newline as arg separator to preserve spaces in args 1.63 +DUALCASE=1 # for MKS: make case statement case-sensitive (6709498) 1.64 +saveIFS="$IFS" 1.65 +nl=' 1.66 +' 1.67 +for i in "$@" ; do 1.68 + IFS= 1.69 + case $i in 1.70 + -J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;; 1.71 + * ) toolOpts=$toolOpts$nl$i ;; 1.72 + esac 1.73 + IFS="$saveIFS" 1.74 +done 1.75 +unset DUALCASE 1.76 + 1.77 +IFS=$nl 1.78 +"#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mylib}/#PROGRAM#.jar" ${toolOpts}