src/share/bin/launcher.sh-template

Sat, 01 Dec 2007 00:00:00 +0000

author
duke
date
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1
9a66ca7c79fa
child 308
03944ee4fac4
permissions
-rw-r--r--

Initial load

     1 #!/bin/sh
     3 #
     4 # Copyright 2006-2007 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 # javac currently assumes that assertions are enabled in the launcher
    48 ea=-ea:com.sun.tools
    50 "#TARGET_JAVA#" ${bcp:+-Xbootclasspath/p:"$bcp"} ${ea} -jar "${mydir}"/../lib/#PROGRAM#.jar "$@"

mercurial