diff -r f63f13da91c0 -r 1b08af362a30 src/jdk.packager/unix/scripts/jpackager --- a/src/jdk.packager/unix/scripts/jpackager Fri Nov 02 11:34:56 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -#!/bin/bash -# -# Java Packager tool execution script for Linux and MacOS. -# - -# Default values. -DEBUG="" -MEMORY="-Xmx512M" -JAVA_ARGS="" -DEBUG_ARG="-J-Xdebug:"; - -# Argument parsing. -args= -narg=1 -for i in "$@"; do - if [[ "$i" == "-J-Xmx"* ]]; then - ARGUMENT=${i:2} - MEMORY=${ARGUMENT} - elif [[ "$i" == ${DEBUG_ARG}* ]]; then - ADDRESS=${i:${#DEBUG_ARG}} - DEBUG="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=${ADDRESS}" - elif [[ "$i" == "-J-"* ]]; then - ARGUMENT=${i:2} - JAVA_ARGS="${JAVA_ARGS} ${ARGUMENT}" - else - args="$args \"$""{"$narg"}\"" - fi - narg=`expr $narg + 1` -done - -# resolve symlinks -PRG=$0 -while [ -h "$PRG" ]; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null` - if expr "$link" : '^/' 2> /dev/null >/dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi -done - -# detect Darwin and Cygwin environments -darwin=false; -cygwin=false; -case "`uname`" in - Darwin*) darwin=true; - if [ -z "$JAVA_HOME" ] ; then - BIN_DIR=`dirname $PRG` - JAVA_HOME=`cd $BIN_DIR > /dev/null; pwd`/.. - fi - ;; - CYGWIN*) cygwin=true;; -esac - -JAVA_PACKAGER_PATH=$(cd $(dirname $0) ; pwd -P) -JAVA_CMD="${JAVA_PACKAGER_PATH}/java" - -if [[ ! -f ${JAVA_CMD} ]]; then - if [ -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/javac" ] ; then - JAVA_CMD="$JAVA_HOME/bin/java" - export JAVA_HOME - else - JAVAC_CMD=`which javac 2> /dev/null ` - while [ -h "$JAVAC_CMD" ]; do - ls=`ls -ld "$JAVAC_CMD"` - link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null` - if expr "$link" : '^/' 2> /dev/null >/dev/null; then - JAVAC_CMD="$link" - else - JAVAC_CMD="`dirname "$JAVAC_CMD"`/$link" - fi - done - - BIN_DIR=`dirname "$JAVAC_CMD"` - JAVA_HOME=`dirname "$BIN_DIR"` - if [ "m$JAVA_HOME" != "m." ]; then - JAVA_CMD="$JAVA_HOME/bin/java" - export JAVA_HOME - else - unset JAVA_HOME - JAVA_CMD=`which java 2> /dev/null ` - if [ -z "$JAVA_CMD" ]; then - JAVA_CMD="java" - fi - fi - fi -fi - -if [ ! -x "$JAVA_CMD" ] ; then - echo 'Error: JAVA_HOME is not defined, cannot find "java" command.' - exit 1 -fi - -if $cygwin ; then - JAVA_CMD=`cygpath --unix "$JAVA_CMD"` -fi - -# This is similar to "$@" except we had to strip out some arguments -# that we don't want to be passed to the Java Packager. -eval exec "$JAVA_CMD" ${DEBUG} ${MEMORY} ${JAVA_ARGS} \ - -m jdk.packager/jdk.packager.main.Main $args -