src/share/bin/launcher.sh-template

Fri, 26 Jun 2009 18:51:39 -0700

author
jjg
date
Fri, 26 Jun 2009 18:51:39 -0700
changeset 308
03944ee4fac4
parent 1
9a66ca7c79fa
child 313
7913e72a24b0
permissions
-rw-r--r--

6843077: JSR 308: Annotations on types
Reviewed-by: jjg, mcimadamore, darcy
Contributed-by: mernst@cs.washington.edu, mali@csail.mit.edu, mpapi@csail.mit.edu

     1 #!/bin/sh
     3 #
     4 # Copyright 2006-2009 Sun Microsystems, Inc.  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.  Sun designates this
    10 # particular file as subject to the "Classpath" exception as provided
    11 # by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    24 # CA 95054 USA or visit www.sun.com if you need additional information or
    25 # have any questions.
    26 #
    28 mydir="`dirname $0`"
    29 mylib="`dirname $mydir`"/lib
    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.
    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
    47 # tools currently assumes that assertions are enabled in the launcher
    48 ea=-ea:com.sun.tools
    50 # Any parameters starting with -J are passed to the JVM.
    51 # All other parameters become parameters of #PROGRAM#.
    53 # Separate out -J* options for the JVM
    54 # Note jdk as possible default to run jtreg
    55 # Unset IFS and use newline as arg separator to preserve spaces in args
    56 DUALCASE=1  # for MKS: make case statement case-sensitive (6709498)
    57 saveIFS="$IFS"
    58 nl='
    59 '
    60 for i in "$@" ; do
    61    IFS=
    62    case $i in
    63    -J* )       javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
    64    *   )       toolOpts=$toolOpts$nl$i ;;
    65    esac
    66    IFS="$saveIFS"
    67 done
    68 unset DUALCASE
    70 eval "#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mydir}"/../lib/#PROGRAM#.jar ${toolOpts}

mercurial