author | jwilhelm |
Sat, 05 Mar 2016 10:10:16 +0100 | |
changeset 36291 | ea8cd1782bc0 |
parent 33362 | 65ec6de1d6b4 |
child 36526 | 3b41f1c69604 |
permissions | -rw-r--r-- |
10 | 1 |
#!/bin/sh |
2 |
||
3 |
# |
|
33362
65ec6de1d6b4
8134254: JShell API/tool: REPL for Java into JDK9
jlahoda
parents:
27546
diff
changeset
|
4 |
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
|
5520 | 9 |
# published by the Free Software Foundation. Oracle designates this |
10 | 10 |
# particular file as subject to the "Classpath" exception as provided |
5520 | 11 |
# by Oracle in the LICENSE file that accompanied this code. |
10 | 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 |
# |
|
5520 | 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. |
|
10 | 26 |
# |
27 |
||
28 |
mydir="`dirname $0`" |
|
7843
1103fac3fb5a
7008378: javac bootstrap launcher fails on cygwin when called via an absolute path
jjh
parents:
6574
diff
changeset
|
29 |
case `uname -s` in |
1103fac3fb5a
7008378: javac bootstrap launcher fails on cygwin when called via an absolute path
jjh
parents:
6574
diff
changeset
|
30 |
CYGWIN*) |
1103fac3fb5a
7008378: javac bootstrap launcher fails on cygwin when called via an absolute path
jjh
parents:
6574
diff
changeset
|
31 |
mydir=`cygpath -m $mydir` |
1103fac3fb5a
7008378: javac bootstrap launcher fails on cygwin when called via an absolute path
jjh
parents:
6574
diff
changeset
|
32 |
;; |
1103fac3fb5a
7008378: javac bootstrap launcher fails on cygwin when called via an absolute path
jjh
parents:
6574
diff
changeset
|
33 |
esac |
8421
b268534d3e7a
7018447: langtools launcher template fails if tools run from their own directory
jjg
parents:
7843
diff
changeset
|
34 |
mylib="$mydir/../lib" |
10 | 35 |
|
36 |
# By default, put the jar file and its dependencies on the bootclasspath. |
|
37 |
# This is always required on a Mac, because the system langtools classes |
|
38 |
# are always on the main class path; in addition, it may be required on |
|
39 |
# standard versions of JDK (i.e. using rt.jar and tools.jar) because some |
|
40 |
# langtools interfaces are in rt.jar. |
|
41 |
# Assume that the jar file being invoked lists all the necessary langtools |
|
42 |
# jar files in its Class-Path manifest entry, so there is no need to search |
|
43 |
# dependent jar files for additional dependencies. |
|
44 |
||
45 |
if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then |
|
27546
79b6b60ff60a
8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents:
25874
diff
changeset
|
46 |
cp=`echo "$mylib"/*.jar | |
79b6b60ff60a
8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents:
25874
diff
changeset
|
47 |
sed -e 's|\([a-z.]*\.jar\) *|\1#PS#|g'` |
79b6b60ff60a
8058489: More adjustments of langtools/make/build.xml to modularized layout
jlahoda
parents:
25874
diff
changeset
|
48 |
bcp=$cp |
10 | 49 |
fi |
50 |
||
3149 | 51 |
# tools currently assumes that assertions are enabled in the launcher |
3654 | 52 |
ea=-ea:com.sun.tools... |
10 | 53 |
|
3149 | 54 |
# Any parameters starting with -J are passed to the JVM. |
55 |
# All other parameters become parameters of #PROGRAM#. |
|
56 |
||
57 |
# Separate out -J* options for the JVM |
|
58 |
# Unset IFS and use newline as arg separator to preserve spaces in args |
|
59 |
DUALCASE=1 # for MKS: make case statement case-sensitive (6709498) |
|
60 |
saveIFS="$IFS" |
|
61 |
nl=' |
|
62 |
' |
|
63 |
for i in "$@" ; do |
|
64 |
IFS= |
|
65 |
case $i in |
|
66 |
-J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;; |
|
67 |
* ) toolOpts=$toolOpts$nl$i ;; |
|
68 |
esac |
|
69 |
IFS="$saveIFS" |
|
70 |
done |
|
71 |
unset DUALCASE |
|
72 |
||
5490
a237b108549d
6948251: need to quote args in langtools launcher script
jjg
parents:
4706
diff
changeset
|
73 |
IFS=$nl |
33362
65ec6de1d6b4
8134254: JShell API/tool: REPL for Java into JDK9
jlahoda
parents:
27546
diff
changeset
|
74 |
"#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} #PROGRAM# ${toolOpts} |