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