Shell инсталятор

Тема в разделе "Коммерческие", создана пользователем Maza, 23 дек 2010.

Информация :
Публиковать (для всех) нуленые версии, особенно от modulesgarden КАТЕГОРИЧЕСКИ не стоит. Тема мониторится оным разработчиком, а к нам приходят абузы которые нельзя игнорировать.
Статус темы:
Закрыта.
Модераторы: Amazko, Aste
  1. Maza

    Maza

    Регистр.:
    3 июл 2007
    Сообщения:
    255
    Симпатии:
    118
    Добрый вечер, кто писал инсталяторы под nix подскажите, как написать, нужен исталлер на подобе netbeans.
    Загвоздка в том, где хранятся пути для Javahome и как проверить установлена ли Java на машине?

    Исходник shell скрипта вот он ->
    Не понятен момен зачем производят якобы установку jvm и тестируют test class на ней.


    Код:
    #!/bin/sh
    #
    # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    #
    # Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
    #
    # Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    # Other names may be trademarks of their respective owners.
    #
    # The contents of this file are subject to the terms of either the GNU General Public
    # License Version 2 only ("GPL") or the Common Development and Distribution
    # License("CDDL") (collectively, the "License"). You may not use this file except in
    # compliance with the License. You can obtain a copy of the License at
    # http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the
    # License for the specific language governing permissions and limitations under the
    # License.  When distributing the software, include this License Header Notice in
    # each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP.  Oracle
    # designates this particular file as subject to the "Classpath" exception as provided
    # by Oracle in the GPL Version 2 section of the License file that accompanied this code.
    # If applicable, add the following below the License Header, with the fields enclosed
    # by brackets [] replaced by your own identifying information:
    # "Portions Copyrighted [year] [name of copyright owner]"
    # 
    # Contributor(s):
    # 
    # The Original Software is NetBeans. The Initial Developer of the Original Software
    # is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun Microsystems, Inc. All
    # Rights Reserved.
    # 
    # If you wish your version of this file to be governed by only the CDDL or only the
    # GPL Version 2, indicate your decision by adding "[Contributor] elects to include
    # this software in this distribution under the [CDDL or GPL Version 2] license." If
    # you do not indicate a single choice of license, a recipient has the option to
    # distribute your version of this file under either the CDDL, the GPL Version 2 or
    # to extend the choice of license to its licensees as provided above. However, if you
    # add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the
    # option applies only if the new code is made subject to such option by the copyright
    # holder.
    # 
    
    ARG_JAVAHOME="--javahome"
    ARG_VERBOSE="--verbose"
    ARG_OUTPUT="--output"
    ARG_EXTRACT="--extract"
    ARG_JAVA_ARG_PREFIX="-J"
    ARG_TEMPDIR="--tempdir"
    ARG_CLASSPATHA="--classpath-append"
    ARG_CLASSPATHP="--classpath-prepend"
    ARG_HELP="--help"
    ARG_SILENT="--silent"
    ARG_NOSPACECHECK="--nospacecheck"
    ARG_LOCALE="--locale"
    
    USE_DEBUG_OUTPUT=0
    PERFORM_FREE_SPACE_CHECK=1
    SILENT_MODE=0
    EXTRACT_ONLY=0
    SHOW_HELP_ONLY=0
    LOCAL_OVERRIDDEN=0
    APPEND_CP=
    PREPEND_CP=
    LAUNCHER_APP_ARGUMENTS=
    LAUNCHER_JVM_ARGUMENTS=
    ERROR_OK=0
    ERROR_TEMP_DIRECTORY=2
    ERROR_TEST_JVM_FILE=3
    ERROR_JVM_NOT_FOUND=4
    ERROR_JVM_UNCOMPATIBLE=5
    ERROR_EXTRACT_ONLY=6
    ERROR_INPUTOUPUT=7
    ERROR_FREESPACE=8
    ERROR_INTEGRITY=9
    ERROR_MISSING_RESOURCES=10
    ERROR_JVM_EXTRACTION=11
    ERROR_JVM_UNPACKING=12
    ERROR_VERIFY_BUNDLED_JVM=13
    
    VERIFY_OK=1
    VERIFY_NOJAVA=2
    VERIFY_UNCOMPATIBLE=3
    
    MSG_ERROR_JVM_NOT_FOUND="nlu.jvm.notfoundmessage"
    MSG_ERROR_USER_ERROR="nlu.jvm.usererror"
    MSG_ERROR_JVM_UNCOMPATIBLE="nlu.jvm.uncompatible"
    MSG_ERROR_INTEGRITY="nlu.integrity"
    MSG_ERROR_FREESPACE="nlu.freespace"
    MSG_ERROP_MISSING_RESOURCE="nlu.missing.external.resource"
    MSG_ERROR_TMPDIR="nlu.cannot.create.tmpdir"
    
    MSG_ERROR_EXTRACT_JVM="nlu.cannot.extract.bundled.jvm"
    MSG_ERROR_UNPACK_JVM_FILE="nlu.cannot.unpack.jvm.file"
    MSG_ERROR_VERIFY_BUNDLED_JVM="nlu.error.verify.bundled.jvm"
    
    MSG_RUNNING="nlu.running"
    MSG_STARTING="nlu.starting"
    MSG_EXTRACTING="nlu.extracting"
    MSG_PREPARE_JVM="nlu.prepare.jvm"
    MSG_JVM_SEARCH="nlu.jvm.search"
    MSG_ARG_JAVAHOME="nlu.arg.javahome"
    MSG_ARG_VERBOSE="nlu.arg.verbose"
    MSG_ARG_OUTPUT="nlu.arg.output"
    MSG_ARG_EXTRACT="nlu.arg.extract"
    MSG_ARG_TEMPDIR="nlu.arg.tempdir"
    MSG_ARG_CPA="nlu.arg.cpa"
    MSG_ARG_CPP="nlu.arg.cpp"
    MSG_ARG_DISABLE_FREE_SPACE_CHECK="nlu.arg.disable.space.check"
    MSG_ARG_LOCALE="nlu.arg.locale"
    MSG_ARG_SILENT="nlu.arg.silent"
    MSG_ARG_HELP="nlu.arg.help"
    MSG_USAGE="nlu.msg.usage"
    
    isSymlink=
    
    entryPoint() {
            initSymlinkArgument        
    	CURRENT_DIRECTORY=`pwd`
    	LAUNCHER_NAME=`echo $0`
    	parseCommandLineArguments "$@"
    	initializeVariables            
    	setLauncherLocale	
    	debugLauncherArguments "$@"
    	if [ 1 -eq $SHOW_HELP_ONLY ] ; then
    		showHelp
    	fi
    	
            message "$MSG_STARTING"
            createTempDirectory
    	checkFreeSpace "$TOTAL_BUNDLED_FILES_SIZE" "$LAUNCHER_EXTRACT_DIR"	
    
            extractJVMData
    	if [ 0 -eq $EXTRACT_ONLY ] ; then 
                searchJava
    	fi
    
    	extractBundledData
    	verifyIntegrity
    
    	if [ 0 -eq $EXTRACT_ONLY ] ; then 
    	    executeMainClass
    	else 
    	    exitProgram $ERROR_OK
    	fi
    }
    
    initSymlinkArgument() {
            testSymlinkErr=`test -L / 2>&1 > /dev/null`
            if [ -z "$testSymlinkErr" ] ; then
                isSymlink=-L
            else
                isSymlink=-h
            fi
    }
    
    debugLauncherArguments() {
    	debug "Launcher Command : $0"
    	argCounter=1
            while [ $# != 0 ] ; do
    		debug "... argument [$argCounter] = $1"
    		argCounter=`expr "$argCounter" + 1`
    		shift
    	done
    }
    isLauncherCommandArgument() {
    	case "$1" in
    	    $ARG_VERBOSE | $ARG_NOSPACECHECK | $ARG_OUTPUT | $ARG_HELP | $ARG_JAVAHOME | $ARG_TEMPDIR | $ARG_EXTRACT | $ARG_SILENT | $ARG_LOCALE | $ARG_CLASSPATHP | $ARG_CLASSPATHA)
    	    	echo 1
    		;;
    	    *)
    		echo 0
    		;;
    	esac
    }
    
    parseCommandLineArguments() {
    	while [ $# != 0 ]
    	do
    		case "$1" in
    		$ARG_VERBOSE)
                            USE_DEBUG_OUTPUT=1;;
    		$ARG_NOSPACECHECK)
                            PERFORM_FREE_SPACE_CHECK=0
                            parseJvmAppArgument "$1"
                            ;;
                    $ARG_OUTPUT)
    			if [ -n "$2" ] ; then
                            	OUTPUT_FILE="$2"
    				if [ -f "$OUTPUT_FILE" ] ; then
    					# clear output file first
    					rm -f "$OUTPUT_FILE" > /dev/null 2>&1
    					touch "$OUTPUT_FILE"
    				fi
                            	shift
    			fi
    			;;
    		$ARG_HELP)
    			SHOW_HELP_ONLY=1
    			;;
    		$ARG_JAVAHOME)
    			if [ -n "$2" ] ; then
    				LAUNCHER_JAVA="$2"
    				shift
    			fi
    			;;
    		$ARG_TEMPDIR)
    			if [ -n "$2" ] ; then
    				LAUNCHER_JVM_TEMP_DIR="$2"
    				shift
    			fi
    			;;
    		$ARG_EXTRACT)
    			EXTRACT_ONLY=1
    			if [ -n "$2" ] && [ `isLauncherCommandArgument "$2"` -eq 0 ] ; then
    				LAUNCHER_EXTRACT_DIR="$2"
    				shift
    			else
    				LAUNCHER_EXTRACT_DIR="$CURRENT_DIRECTORY"				
    			fi
    			;;
    		$ARG_SILENT)
    			SILENT_MODE=1
    			parseJvmAppArgument "$1"
    			;;
    		$ARG_LOCALE)
    			SYSTEM_LOCALE="$2"
    			LOCAL_OVERRIDDEN=1			
    			parseJvmAppArgument "$1"
    			;;
    		$ARG_CLASSPATHP)
    			if [ -n "$2" ] ; then
    				if [ -z "$PREPEND_CP" ] ; then
    					PREPEND_CP="$2"
    				else
    					PREPEND_CP="$2":"$PREPEND_CP"
    				fi
    				shift
    			fi
    			;;
    		$ARG_CLASSPATHA)
    			if [ -n "$2" ] ; then
    				if [ -z "$APPEND_CP" ] ; then
    					APPEND_CP="$2"
    				else
    					APPEND_CP="$APPEND_CP":"$2"
    				fi
    				shift
    			fi
    			;;
    
    		*)
    			parseJvmAppArgument "$1"
    		esac
                    shift
    	done
    }
    
    setLauncherLocale() {
    	if [ 0 -eq $LOCAL_OVERRIDDEN ] ; then		
            	SYSTEM_LOCALE="$LANG"
    		debug "Setting initial launcher locale from the system : $SYSTEM_LOCALE"
    	else	
    		debug "Setting initial launcher locale using command-line argument : $SYSTEM_LOCALE"
    	fi
    
    	LAUNCHER_LOCALE="$SYSTEM_LOCALE"
    	
    	if [ -n "$LAUNCHER_LOCALE" ] ; then
    		# check if $LAUNCHER_LOCALE is in UTF-8
    		if [ 0 -eq $LOCAL_OVERRIDDEN ] ; then
    			removeUTFsuffix=`echo "$LAUNCHER_LOCALE" | sed "s/\.UTF-8//"`
    			isUTF=`ifEquals "$removeUTFsuffix" "$LAUNCHER_LOCALE"`
    			if [ 1 -eq $isUTF ] ; then
    				#set launcher locale to the default if the system locale name doesn`t containt  UTF-8
    				LAUNCHER_LOCALE=""
    			fi
    		fi
    
            	localeChanged=0	
    		localeCounter=0
    		while [ $localeCounter -lt $LAUNCHER_LOCALES_NUMBER ] ; do		
    		    localeVar="$""LAUNCHER_LOCALE_NAME_$localeCounter"
    		    arg=`eval "echo \"$localeVar\""`		
                        if [ -n "$arg" ] ; then 
                            # if not a default locale			
    			# $comp length shows the difference between $SYSTEM_LOCALE and $arg
      			# the less the length the less the difference and more coincedence
    
                            comp=`echo "$SYSTEM_LOCALE" | sed -e "s/^${arg}//"`				
    			length1=`getStringLength "$comp"`
                            length2=`getStringLength "$LAUNCHER_LOCALE"`
                            if [ $length1 -lt $length2 ] ; then	
    				# more coincidence between $SYSTEM_LOCALE and $arg than between $SYSTEM_LOCALE and $arg
                                    compare=`ifLess "$comp" "$LAUNCHER_LOCALE"`
    				
                                    if [ 1 -eq $compare ] ; then
                                            LAUNCHER_LOCALE="$arg"
                                            localeChanged=1
                                            debug "... setting locale to $arg"
                                    fi
                                    if [ -z "$comp" ] ; then
    					# means that $SYSTEM_LOCALE equals to $arg
                                            break
                                    fi
                            fi   
                        else 
                            comp="$SYSTEM_LOCALE"
                        fi
    		    localeCounter=`expr "$localeCounter" + 1`
           		done
    		if [ $localeChanged -eq 0 ] ; then 
                    	#set default
                    	LAUNCHER_LOCALE=""
            	fi
            fi
    
            
            debug "Final Launcher Locale : $LAUNCHER_LOCALE"	
    }
    
    escapeBackslash() {
    	echo "$1" | sed "s/\\\/\\\\\\\/g"
    }
    
    ifLess() {
    	arg1=`escapeBackslash "$1"`
    	arg2=`escapeBackslash "$2"`
    	compare=`awk 'END { if ( a < b ) { print 1 } else { print 0 } }' a="$arg1" b="$arg2" < /dev/null`
    	echo $compare
    }
    
    formatVersion() {
            formatted=`echo "$1" | sed "s/-ea//g;s/-rc[0-9]*//g;s/-beta[0-9]*//g;s/-preview[0-9]*//g;s/-dp[0-9]*//g;s/-alpha[0-9]*//g;s/-fcs//g;s/_/./g;s/-/\./g"`
            formatted=`echo "$formatted" | sed "s/^\(\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)\)\.b\([0-9][0-9]*\)/\1\.0\.\5/g"`
            formatted=`echo "$formatted" | sed "s/\.b\([0-9][0-9]*\)/\.\1/g"`
    	echo "$formatted"
    
    }
    
    compareVersions() {
            current1=`formatVersion "$1"`
            current2=`formatVersion "$2"`
    	compresult=
    	#0 - equals
    	#-1 - less
    	#1 - more
    
    	while [ -z "$compresult" ] ; do
    		value1=`echo "$current1" | sed "s/\..*//g"`
    		value2=`echo "$current2" | sed "s/\..*//g"`
    
    
    		removeDots1=`echo "$current1" | sed "s/\.//g"`
    		removeDots2=`echo "$current2" | sed "s/\.//g"`
    
    		if [ 1 -eq `ifEquals "$current1" "$removeDots1"` ] ; then
    			remainder1=""
    		else
    			remainder1=`echo "$current1" | sed "s/^$value1\.//g"`
    		fi
    		if [ 1 -eq `ifEquals "$current2" "$removeDots2"` ] ; then
    			remainder2=""
    		else
    			remainder2=`echo "$current2" | sed "s/^$value2\.//g"`
    		fi
    
    		current1="$remainder1"
    		current2="$remainder2"
    		
    		if [ -z "$value1" ] || [ 0 -eq `ifNumber "$value1"` ] ; then 
    			value1=0 
    		fi
    		if [ -z "$value2" ] || [ 0 -eq `ifNumber "$value2"` ] ; then 
    			value2=0 
    		fi
    		if [ "$value1" -gt "$value2" ] ; then 
    			compresult=1
    			break
    		elif [ "$value2" -gt "$value1" ] ; then 
    			compresult=-1
    			break
    		fi
    
    		if [ -z "$current1" ] && [ -z "$current2" ] ; then	
    			compresult=0
    			break
    		fi
    	done
    	echo $compresult
    }
    
    ifVersionLess() {
    	compareResult=`compareVersions "$1" "$2"`
            if [ -1 -eq $compareResult ] ; then
                echo 1
            else
                echo 0
            fi
    }
    
    ifVersionGreater() {
    	compareResult=`compareVersions "$1" "$2"`
            if [ 1 -eq $compareResult ] ; then
                echo 1
            else
                echo 0
            fi
    }
    
    ifGreater() {
    	arg1=`escapeBackslash "$1"`
    	arg2=`escapeBackslash "$2"`
    
    	compare=`awk 'END { if ( a > b ) { print 1 } else { print 0 } }' a="$arg1" b="$arg2" < /dev/null`
    	echo $compare
    }
    
    ifEquals() {
    	arg1=`escapeBackslash "$1"`
    	arg2=`escapeBackslash "$2"`
    
    	compare=`awk 'END { if ( a == b ) { print 1 } else { print 0 } }' a="$arg1" b="$arg2" < /dev/null`
    	echo $compare
    }
    
    ifNumber() 
    {
    	result=0
    	if  [ -n "$1" ] ; then 
    		num=`echo "$1" | sed 's/[0-9]*//g' 2>/dev/null`
    		if [ -z "$num" ] ; then
    			result=1
    		fi
    	fi 
    	echo $result
    }
    getStringLength() {
        strlength=`awk 'END{ print length(a) }' a="$1" < /dev/null`
        echo $strlength
    }
    
    resolveRelativity() {
    	if [ 1 -eq `ifPathRelative "$1"` ] ; then
    		echo "$CURRENT_DIRECTORY"/"$1" | sed 's/\"//g' 2>/dev/null
    	else 
    		echo "$1"
    	fi
    }
    
    ifPathRelative() {
    	param="$1"
    	removeRoot=`echo "$param" | sed "s/^\\\///" 2>/dev/null`
    	echo `ifEquals "$param" "$removeRoot"` 2>/dev/null
    }
    
    
    initializeVariables() {	
    	debug "Launcher name is $LAUNCHER_NAME"
    	systemName=`uname`
    	debug "System name is $systemName"
    	isMacOSX=`ifEquals "$systemName" "Darwin"`	
    	isSolaris=`ifEquals "$systemName" "SunOS"`
    	if [ 1 -eq $isSolaris ] ; then
    		POSSIBLE_JAVA_EXE_SUFFIX="$POSSIBLE_JAVA_EXE_SUFFIX_SOLARIS"
    	else
    		POSSIBLE_JAVA_EXE_SUFFIX="$POSSIBLE_JAVA_EXE_SUFFIX_COMMON"
    	fi
    	systemInfo=`uname -a 2>/dev/null`
    	debug "System Information:"
    	debug "$systemInfo"             
    	debug ""
    	DEFAULT_DISK_BLOCK_SIZE=512
    	LAUNCHER_TRACKING_SIZE=$LAUNCHER_STUB_SIZE
    	LAUNCHER_TRACKING_SIZE_BYTES=`expr "$LAUNCHER_STUB_SIZE" \* "$FILE_BLOCK_SIZE"`
    	getLauncherLocation
    }
    
    parseJvmAppArgument() {
            param="$1"
    	arg=`echo "$param" | sed "s/^-J//"`
    	argEscaped=`escapeString "$arg"`
    
    	if [ "$param" = "$arg" ] ; then
    	    LAUNCHER_APP_ARGUMENTS="$LAUNCHER_APP_ARGUMENTS $argEscaped"
    	else
    	    LAUNCHER_JVM_ARGUMENTS="$LAUNCHER_JVM_ARGUMENTS $argEscaped"
    	fi	
    }
    
    getLauncherLocation() {
    	# if file path is relative then prepend it with current directory
    	LAUNCHER_FULL_PATH=`resolveRelativity "$LAUNCHER_NAME"`
    	debug "... normalizing full path"
    	LAUNCHER_FULL_PATH=`normalizePath "$LAUNCHER_FULL_PATH"`
    	debug "... getting dirname"
    	LAUNCHER_DIR=`dirname "$LAUNCHER_FULL_PATH"`
    	debug "Full launcher path = $LAUNCHER_FULL_PATH"
    	debug "Launcher directory = $LAUNCHER_DIR"
    }
    
    getLauncherSize() {
    	lsOutput=`ls -l --block-size=1 "$LAUNCHER_FULL_PATH" 2>/dev/null`
    	if [ $? -ne 0 ] ; then
    	    #default block size
    	    lsOutput=`ls -l "$LAUNCHER_FULL_PATH" 2>/dev/null`
    	fi
    	echo "$lsOutput" | awk ' { print $5 }' 2>/dev/null
    }
    
    verifyIntegrity() {
    	size=`getLauncherSize`
    	extractedSize=$LAUNCHER_TRACKING_SIZE_BYTES
    	if [ 1 -eq `ifNumber "$size"` ] ; then
    		debug "... check integrity"
    		debug "... minimal size : $extractedSize"
    		debug "... real size    : $size"
    
            	if [ $size -lt $extractedSize ] ; then
    			debug "... integration check FAILED"
    			message "$MSG_ERROR_INTEGRITY" `normalizePath "$LAUNCHER_FULL_PATH"`
    			exitProgram $ERROR_INTEGRITY
    		fi
    		debug "... integration check OK"
    	fi
    }
    showHelp() {
    	msg0=`message "$MSG_USAGE"`
    	msg1=`message "$MSG_ARG_JAVAHOME $ARG_JAVAHOME"`
    	msg2=`message "$MSG_ARG_TEMPDIR $ARG_TEMPDIR"`
    	msg3=`message "$MSG_ARG_EXTRACT $ARG_EXTRACT"`
    	msg4=`message "$MSG_ARG_OUTPUT $ARG_OUTPUT"`
    	msg5=`message "$MSG_ARG_VERBOSE $ARG_VERBOSE"`
    	msg6=`message "$MSG_ARG_CPA $ARG_CLASSPATHA"`
    	msg7=`message "$MSG_ARG_CPP $ARG_CLASSPATHP"`
    	msg8=`message "$MSG_ARG_DISABLE_FREE_SPACE_CHECK $ARG_NOSPACECHECK"`
            msg9=`message "$MSG_ARG_LOCALE $ARG_LOCALE"`
            msg10=`message "$MSG_ARG_SILENT $ARG_SILENT"`
    	msg11=`message "$MSG_ARG_HELP $ARG_HELP"`
    	out "$msg0"
    	out "$msg1"
    	out "$msg2"
    	out "$msg3"
    	out "$msg4"
    	out "$msg5"
    	out "$msg6"
    	out "$msg7"
    	out "$msg8"
    	out "$msg9"
    	out "$msg10"
    	out "$msg11"
    	exitProgram $ERROR_OK
    }
    
    exitProgram() {
    	if [ 0 -eq $EXTRACT_ONLY ] ; then
    	    if [ -n "$LAUNCHER_EXTRACT_DIR" ] && [ -d "$LAUNCHER_EXTRACT_DIR" ]; then		
    		debug "Removing directory $LAUNCHER_EXTRACT_DIR"
    		rm -rf "$LAUNCHER_EXTRACT_DIR" > /dev/null 2>&1
    	    fi
    	fi
    	debug "exitCode = $1"
    	exit $1
    }
    
    debug() {
            if [ $USE_DEBUG_OUTPUT -eq 1 ] ; then
    		timestamp=`date '+%Y-%m-%d %H:%M:%S'`
                    out "[$timestamp]> $1"
            fi
    }
    
    out() {
    	
            if [ -n "$OUTPUT_FILE" ] ; then
                    printf "%s\n" "$@" >> "$OUTPUT_FILE"
            elif [ 0 -eq $SILENT_MODE ] ; then
                    printf "%s\n" "$@"
    	fi
    }
    
    message() {        
            msg=`getMessage "$@"`
            out "$msg"
    }
    
    
    createTempDirectory() {
    	if [ 0 -eq $EXTRACT_ONLY ] ; then
                if [ -z "$LAUNCHER_JVM_TEMP_DIR" ] ; then
    		if [ 0 -eq $EXTRACT_ONLY ] ; then
                        if [ -n "$TEMP" ] && [ -d "$TEMP" ] ; then
                            debug "TEMP var is used : $TEMP"
                            LAUNCHER_JVM_TEMP_DIR="$TEMP"
                        elif [ -n "$TMP" ] && [ -d "$TMP" ] ; then
                            debug "TMP var is used : $TMP"
                            LAUNCHER_JVM_TEMP_DIR="$TMP"
                        elif [ -n "$TEMPDIR" ] && [ -d "$TEMPDIR" ] ; then
                            debug "TEMPDIR var is used : $TEMPDIR"
                            LAUNCHER_JVM_TEMP_DIR="$TEMPDIR"
                        elif [ -d "/tmp" ] ; then
                            debug "Using /tmp for temp"
                            LAUNCHER_JVM_TEMP_DIR="/tmp"
                        else
                            debug "Using home dir for temp"
                            LAUNCHER_JVM_TEMP_DIR="$HOME"
                        fi
    		else
    		    #extract only : to the curdir
    		    LAUNCHER_JVM_TEMP_DIR="$CURRENT_DIRECTORY"		    
    		fi
                fi
                # if temp dir does not exist then try to create it
                if [ ! -d "$LAUNCHER_JVM_TEMP_DIR" ] ; then
                    mkdir -p "$LAUNCHER_JVM_TEMP_DIR" > /dev/null 2>&1
                    if [ $? -ne 0 ] ; then                        
                            message "$MSG_ERROR_TMPDIR" "$LAUNCHER_JVM_TEMP_DIR"
                            exitProgram $ERROR_TEMP_DIRECTORY
                    fi
                fi		
                debug "Launcher TEMP ROOT = $LAUNCHER_JVM_TEMP_DIR"
                subDir=`date '+%u%m%M%S'`
                subDir=`echo ".nbi-$subDir.tmp"`
                LAUNCHER_EXTRACT_DIR="$LAUNCHER_JVM_TEMP_DIR/$subDir"
    	else
    	    #extracting to the $LAUNCHER_EXTRACT_DIR
                debug "Launcher Extracting ROOT = $LAUNCHER_EXTRACT_DIR"
    	fi
    
            if [ ! -d "$LAUNCHER_EXTRACT_DIR" ] ; then
                    mkdir -p "$LAUNCHER_EXTRACT_DIR" > /dev/null 2>&1
                    if [ $? -ne 0 ] ; then                        
                            message "$MSG_ERROR_TMPDIR"  "$LAUNCHER_EXTRACT_DIR"
                            exitProgram $ERROR_TEMP_DIRECTORY
                    fi
            else
                    debug "$LAUNCHER_EXTRACT_DIR is directory and exist"
            fi
            debug "Using directory $LAUNCHER_EXTRACT_DIR for extracting data"
    }
    extractJVMData() {
    	debug "Extracting testJVM file data..."
            extractTestJVMFile
    	debug "Extracting bundled JVMs ..."
    	extractJVMFiles        
    	debug "Extracting JVM data done"
    }
    extractBundledData() {
    	message "$MSG_EXTRACTING"
    	debug "Extracting bundled jars  data..."
    	extractJars		
    	debug "Extracting other  data..."
    	extractOtherData
    	debug "Extracting bundled data finished..."
    }
    
    setTestJVMClasspath() {
    	testjvmname=`basename "$TEST_JVM_PATH"`
    	removeClassSuffix=`echo "$testjvmname" | sed 's/\.class$//'`
    	notClassFile=`ifEquals "$testjvmname" "$removeClassSuffix"`
    		
    	if [ -d "$TEST_JVM_PATH" ] ; then
    		TEST_JVM_CLASSPATH="$TEST_JVM_PATH"
    		debug "... testJVM path is a directory"
    	elif [ $isSymlink "$TEST_JVM_PATH" ] && [ $notClassFile -eq 1 ] ; then
    		TEST_JVM_CLASSPATH="$TEST_JVM_PATH"
    		debug "... testJVM path is a link but not a .class file"
    	else
    		if [ $notClassFile -eq 1 ] ; then
    			debug "... testJVM path is a jar/zip file"
    			TEST_JVM_CLASSPATH="$TEST_JVM_PATH"
    		else
    			debug "... testJVM path is a .class file"
    			TEST_JVM_CLASSPATH=`dirname "$TEST_JVM_PATH"`
    		fi        
    	fi
    	debug "... testJVM classpath is : $TEST_JVM_CLASSPATH"
    }
    
    extractTestJVMFile() {
            TEST_JVM_PATH=`resolveResourcePath "TEST_JVM_FILE"`
    	extractResource "TEST_JVM_FILE"
    	setTestJVMClasspath
            
    }
    
    installJVM() {
    	message "$MSG_PREPARE_JVM"	
    	jvmFile=`resolveRelativity "$1"`
    	jvmDir=`dirname "$jvmFile"`/_jvm
    	debug "JVM Directory : $jvmDir"
    	mkdir "$jvmDir" > /dev/null 2>&1
    	if [ $? != 0 ] ; then
    		message "$MSG_ERROR_EXTRACT_JVM"
    		exitProgram $ERROR_JVM_EXTRACTION
    	fi
            chmod +x "$jvmFile" > /dev/null  2>&1
    	jvmFileEscaped=`escapeString "$jvmFile"`
            jvmDirEscaped=`escapeString "$jvmDir"`
    	cd "$jvmDir"
            runCommand "$jvmFileEscaped"
    	ERROR_CODE=$?
    
            cd "$CURRENT_DIRECTORY"
    
    	if [ $ERROR_CODE != 0 ] ; then		
    	        message "$MSG_ERROR_EXTRACT_JVM"
    		exitProgram $ERROR_JVM_EXTRACTION
    	fi
    	
    	files=`find "$jvmDir" -name "*.jar.pack.gz" -print`
    	debug "Packed files : $files"
    	f="$files"
    	fileCounter=1;
    	while [ -n "$f" ] ; do
    		f=`echo "$files" | sed -n "${fileCounter}p" 2>/dev/null`
    		debug "... next file is $f"				
    		if [ -n "$f" ] ; then
    			debug "... packed file  = $f"
    			unpacked=`echo "$f" | sed s/\.pack\.gz//`
    			debug "... unpacked file = $unpacked"
    			fEsc=`escapeString "$f"`
    			uEsc=`escapeString "$unpacked"`
    			cmd="$jvmDirEscaped/bin/unpack200 $fEsc $uEsc"
    			runCommand "$cmd"
    			if [ $? != 0 ] ; then
    			    message "$MSG_ERROR_UNPACK_JVM_FILE" "$f"
    			    exitProgram $ERROR_JVM_UNPACKING
    			fi		
    		fi					
    		fileCounter=`expr "$fileCounter" + 1`
    	done
    		
    	verifyJVM "$jvmDir"
    	if [ -z "$LAUNCHER_JAVA_EXE" ] ; then
    		message "$MSG_ERROR_VERIFY_BUNDLED_JVM"
    		exitProgram $ERROR_VERIFY_BUNDLED_JVM
    	fi
    }
    
    resolveResourcePath() {
    	resourcePrefix="$1"
    	resourceVar="$""$resourcePrefix""_PATH"
    	resourceName=`eval "echo \"$resourceVar\""`
    	resourcePath=`resolveString "$resourceName"`
        	echo "$resourcePath"
    
    }
    
    resolveResourceSize() {
    	resourcePrefix="$1"
    	resourceVar="$""$resourcePrefix""_SIZE"
    	resourceSize=`eval "echo \"$resourceVar\""`
        	echo "$resourceSize"
    }
    
    resolveResourceMd5() {
    	resourcePrefix="$1"
    	resourceVar="$""$resourcePrefix""_MD5"
    	resourceMd5=`eval "echo \"$resourceVar\""`
        	echo "$resourceMd5"
    }
    
    resolveResourceType() {
    	resourcePrefix="$1"
    	resourceVar="$""$resourcePrefix""_TYPE"
    	resourceType=`eval "echo \"$resourceVar\""`
    	echo "$resourceType"
    }
    
    extractResource() {	
    	debug "... extracting resource" 
            resourcePrefix="$1"
    	debug "... resource prefix id=$resourcePrefix"	
    	resourceType=`resolveResourceType "$resourcePrefix"`
    	debug "... resource type=$resourceType"	
    	if [ $resourceType -eq 0 ] ; then
                    resourceSize=`resolveResourceSize "$resourcePrefix"`
    		debug "... resource size=$resourceSize"
                	resourcePath=`resolveResourcePath "$resourcePrefix"`
    	    	debug "... resource path=$resourcePath"
                	extractFile "$resourceSize" "$resourcePath"
                    resourceMd5=`resolveResourceMd5 "$resourcePrefix"`
    	    	debug "... resource md5=$resourceMd5"
                    checkMd5 "$resourcePath" "$resourceMd5"
    		debug "... done"
    	fi
    	debug "... extracting resource finished"	
            
    }
    
    extractJars() {
            counter=0
    	while [ $counter -lt $JARS_NUMBER ] ; do
    		extractResource "JAR_$counter"
    		counter=`expr "$counter" + 1`
    	done
    }
    
    extractOtherData() {
            counter=0
    	while [ $counter -lt $OTHER_RESOURCES_NUMBER ] ; do
    		extractResource "OTHER_RESOURCE_$counter"
    		counter=`expr "$counter" + 1`
    	done
    }
    
    extractJVMFiles() {
    	javaCounter=0
    	debug "... total number of JVM files : $JAVA_LOCATION_NUMBER"
    	while [ $javaCounter -lt $JAVA_LOCATION_NUMBER ] ; do		
    		extractResource "JAVA_LOCATION_$javaCounter"
    		javaCounter=`expr "$javaCounter" + 1`
    	done
    }
    
    
    processJarsClasspath() {
    	JARS_CLASSPATH=""
    	jarsCounter=0
    	while [ $jarsCounter -lt $JARS_NUMBER ] ; do
    		resolvedFile=`resolveResourcePath "JAR_$jarsCounter"`
    		debug "... adding jar to classpath : $resolvedFile"
    		if [ ! -f "$resolvedFile" ] && [ ! -d "$resolvedFile" ] && [ ! $isSymlink "$resolvedFile" ] ; then
    				message "$MSG_ERROP_MISSING_RESOURCE" "$resolvedFile"
    				exitProgram $ERROR_MISSING_RESOURCES
    		else
    			if [ -z "$JARS_CLASSPATH" ] ; then
    				JARS_CLASSPATH="$resolvedFile"
    			else				
    				JARS_CLASSPATH="$JARS_CLASSPATH":"$resolvedFile"
    			fi
    		fi			
    			
    		jarsCounter=`expr "$jarsCounter" + 1`
    	done
    	debug "Jars classpath : $JARS_CLASSPATH"
    }
    
    extractFile() {
            start=$LAUNCHER_TRACKING_SIZE
            size=$1 #absolute size
            name="$2" #relative part        
            fullBlocks=`expr $size / $FILE_BLOCK_SIZE`
            fullBlocksSize=`expr "$FILE_BLOCK_SIZE" \* "$fullBlocks"`
            oneBlocks=`expr  $size - $fullBlocksSize`
    	oneBlocksStart=`expr "$start" + "$fullBlocks"`
    
    	checkFreeSpace $size "$name"	
    	LAUNCHER_TRACKING_SIZE_BYTES=`expr "$LAUNCHER_TRACKING_SIZE" \* "$FILE_BLOCK_SIZE"`
    
    	if [ 0 -eq $diskSpaceCheck ] ; then
    		dir=`dirname "$name"`
    		message "$MSG_ERROR_FREESPACE" "$size" "$ARG_TEMPDIR"	
    		exitProgram $ERROR_FREESPACE
    	fi
    
            if [ 0 -lt "$fullBlocks" ] ; then
                    # file is larger than FILE_BLOCK_SIZE
                    dd if="$LAUNCHER_FULL_PATH" of="$name" \
                            bs="$FILE_BLOCK_SIZE" count="$fullBlocks" skip="$start"\
    			> /dev/null  2>&1
    		LAUNCHER_TRACKING_SIZE=`expr "$LAUNCHER_TRACKING_SIZE" + "$fullBlocks"`
    		LAUNCHER_TRACKING_SIZE_BYTES=`expr "$LAUNCHER_TRACKING_SIZE" \* "$FILE_BLOCK_SIZE"`
            fi
            if [ 0 -lt "$oneBlocks" ] ; then
    		dd if="$LAUNCHER_FULL_PATH" of="$name.tmp.tmp" bs="$FILE_BLOCK_SIZE" count=1\
    			skip="$oneBlocksStart"\
    			 > /dev/null 2>&1
    
    		dd if="$name.tmp.tmp" of="$name" bs=1 count="$oneBlocks" seek="$fullBlocksSize"\
    			 > /dev/null 2>&1
    
    		rm -f "$name.tmp.tmp"
    		LAUNCHER_TRACKING_SIZE=`expr "$LAUNCHER_TRACKING_SIZE" + 1`
    
    		LAUNCHER_TRACKING_SIZE_BYTES=`expr "$LAUNCHER_TRACKING_SIZE_BYTES" + "$oneBlocks"`
            fi        
    }
    
    md5_program=""
    no_md5_program_id="no_md5_program"
    
    initMD5program() {
        if [ -z "$md5_program" ] ; then 
            type digest >> /dev/null 2>&1
            if [ 0 -eq $? ] ; then
                md5_program="digest -a md5"
            else
                type md5sum >> /dev/null 2>&1
                if [ 0 -eq $? ] ; then
                    md5_program="md5sum"
                else 
                    type gmd5sum >> /dev/null 2>&1
                    if [ 0 -eq $? ] ; then
                        md5_program="gmd5sum"
                    else
                        type md5 >> /dev/null 2>&1
                        if [ 0 -eq $? ] ; then
                            md5_program="md5 -q"
                        else 
                            md5_program="$no_md5_program_id"
                        fi
                    fi
                fi
            fi
            debug "... program to check: $md5_program"
        fi
    }
    
    checkMd5() {
         name="$1"
         md5="$2"     
         if [ 32 -eq `getStringLength "$md5"` ] ; then
             #do MD5 check         
             initMD5program            
             if [ 0 -eq `ifEquals "$md5_program" "$no_md5_program_id"` ] ; then
                debug "... check MD5 of file : $name"           
                debug "... expected md5: $md5"
                realmd5=`$md5_program "$name" 2>/dev/null | sed "s/ .*//g"`
                debug "... real md5 : $realmd5"
                if [ 32 -eq `getStringLength "$realmd5"` ] ; then
                    if [ 0 -eq `ifEquals "$md5" "$realmd5"` ] ; then
                            debug "... integration check FAILED"
    			message "$MSG_ERROR_INTEGRITY" `normalizePath "$LAUNCHER_FULL_PATH"`
    			exitProgram $ERROR_INTEGRITY
                    fi
                else
                    debug "... looks like not the MD5 sum"
                fi
             fi
         fi   
    }
    searchJavaEnvironment() {
         if [ -z "$LAUNCHER_JAVA_EXE" ] ; then
    		    # search java in the environment
    		
                	    ptr="$POSSIBLE_JAVA_ENV"
                	    while [ -n "$ptr" ] && [ -z "$LAUNCHER_JAVA_EXE" ] ; do
    			argJavaHome=`echo "$ptr" | sed "s/:.*//"`
    			back=`echo "$argJavaHome" | sed "s/\\\//\\\\\\\\\//g"`
    		    	end=`echo "$ptr"       | sed "s/${back}://"`
    			argJavaHome=`echo "$back" | sed "s/\\\\\\\\\//\\\//g"`
    			ptr="$end"
                            eval evaluated=`echo \\$$argJavaHome` > /dev/null
                            if [ -n "$evaluated" ] ; then
                                    debug "EnvVar $argJavaHome=$evaluated"				
                                    verifyJVM "$evaluated"
                            fi
                	    done
         fi
    }
    
    installBundledJVMs() {
    	if [ -z "$LAUNCHER_JAVA_EXE" ] ; then
    	    # search bundled java in the common list
    	    javaCounter=0
        	    while [ $javaCounter -lt $JAVA_LOCATION_NUMBER ] && [ -z "$LAUNCHER_JAVA_EXE" ] ; do
    	    	fileType=`resolveResourceType "JAVA_LOCATION_$javaCounter"`
    		
    		if [ $fileType -eq 0 ] ; then # bundled->install
    			argJavaHome=`resolveResourcePath "JAVA_LOCATION_$javaCounter"`
    			installJVM  "$argJavaHome"				
            	fi
    		javaCounter=`expr "$javaCounter" + 1`
        	    done
    	fi
    }
    
    searchJavaSystemDefault() {
            if [ -z "$LAUNCHER_JAVA_EXE" ] ; then
                debug "... check default java in the path"
                java_bin=`which java 2>&1`
                if [ $? -eq 0 ] && [ -n "$java_bin" ] ; then
                    remove_no_java_in=`echo "$java_bin" | sed "s/no java in//g"`
                    if [ 1 -eq `ifEquals "$remove_no_java_in" "$java_bin"` ] && [ -f "$java_bin" ] ; then
                        debug "... java in path found: $java_bin"
                        # java is in path
                        java_bin=`resolveSymlink "$java_bin"`
                        debug "... java real path: $java_bin"
                        parentDir=`dirname "$java_bin"`
                        if [ -n "$parentDir" ] ; then
                            parentDir=`dirname "$parentDir"`
                            if [ -n "$parentDir" ] ; then
                                debug "... java home path: $parentDir"
                                parentDir=`resolveSymlink "$parentDir"`
                                debug "... java home real path: $parentDir"
                                verifyJVM "$parentDir"
                            fi
                        fi
                    fi
                fi
    	fi
    }
    
    searchJavaSystemPaths() {
    	if [ -z "$LAUNCHER_JAVA_EXE" ] ; then
    	    # search java in the common system paths
    	    javaCounter=0
        	    while [ $javaCounter -lt $JAVA_LOCATION_NUMBER ] && [ -z "$LAUNCHER_JAVA_EXE" ] ; do
    	    	fileType=`resolveResourceType "JAVA_LOCATION_$javaCounter"`
    	    	argJavaHome=`resolveResourcePath "JAVA_LOCATION_$javaCounter"`
    
    	    	debug "... next location $argJavaHome"
    		
    		if [ $fileType -ne 0 ] ; then # bundled JVMs have already been proceeded
    			argJavaHome=`escapeString "$argJavaHome"`
    			locations=`ls -d -1 $argJavaHome 2>/dev/null`
    			nextItem="$locations"
    			itemCounter=1
    			while [ -n "$nextItem" ] && [ -z "$LAUNCHER_JAVA_EXE" ] ; do
    				nextItem=`echo "$locations" | sed -n "${itemCounter}p" 2>/dev/null`
    				debug "... next item is $nextItem"				
    				nextItem=`removeEndSlashes "$nextItem"`
    				if [ -n "$nextItem" ] ; then
    					if [ -d "$nextItem" ] || [ $isSymlink "$nextItem" ] ; then
    	               				debug "... checking item : $nextItem"
    						verifyJVM "$nextItem"
    					fi
    				fi					
    				itemCounter=`expr "$itemCounter" + 1`
    			done
    		fi
    		javaCounter=`expr "$javaCounter" + 1`
        	    done
    	fi
    }
    
    searchJavaUserDefined() {
    	if [ -z "$LAUNCHER_JAVA_EXE" ] ; then
            	if [ -n "$LAUNCHER_JAVA" ] ; then
                    	verifyJVM "$LAUNCHER_JAVA"
    		
    			if [ $VERIFY_UNCOMPATIBLE -eq $verifyResult ] ; then
    		    		message "$MSG_ERROR_JVM_UNCOMPATIBLE" "$LAUNCHER_JAVA" "$ARG_JAVAHOME"
    		    		exitProgram $ERROR_JVM_UNCOMPATIBLE
    			elif [ $VERIFY_NOJAVA -eq $verifyResult ] ; then
    				message "$MSG_ERROR_USER_ERROR" "$LAUNCHER_JAVA"
    		    		exitProgram $ERROR_JVM_NOT_FOUND
    			fi
            	fi
    	fi
    }
    searchJava() {
    	message "$MSG_JVM_SEARCH"
            if [ ! -f "$TEST_JVM_CLASSPATH" ] && [ ! $isSymlink "$TEST_JVM_CLASSPATH" ] && [ ! -d "$TEST_JVM_CLASSPATH" ]; then
                    debug "Cannot find file for testing JVM at $TEST_JVM_CLASSPATH"
    		message "$MSG_ERROR_JVM_NOT_FOUND" "$ARG_JAVAHOME"
                    exitProgram $ERROR_TEST_JVM_FILE
            else		
    		searchJavaUserDefined
    		installBundledJVMs
    		searchJavaEnvironment
    		searchJavaSystemDefault
    		searchJavaSystemPaths		
            fi
    
    	if [ -z "$LAUNCHER_JAVA_EXE" ] ; then
    		message "$MSG_ERROR_JVM_NOT_FOUND" "$ARG_JAVAHOME"
    		exitProgram $ERROR_JVM_NOT_FOUND
    	fi
    }
    
    normalizePath() {	
    	argument="$1"
    
    	# replace XXX/../YYY to 'dirname XXX'/YYY
    	while [ 0 -eq 0 ] ; do	
    		beforeDotDot=`echo "$argument" | sed "s/\/\.\.\/.*//g" 2> /dev/null`
                    if [ 0 -eq `ifEquals "$beforeDotDot" "$argument"` ] && [ 0 -eq `ifEquals "$beforeDotDot" "."` ] && [ 0 -eq `ifEquals "$beforeDotDot" ".."` ] ; then
    	            esc=`echo "$beforeDotDot" | sed "s/\\\//\\\\\\\\\//g"`
                        afterDotDot=`echo "$argument" | sed "s/^$esc\/\.\.//g" 2> /dev/null` 
    		    parent=`dirname "$beforeDotDot"`
    		    argument=`echo "$parent""$afterDotDot"`
    		else 
                        break
    		fi	
    	done
    
    	# replace XXX/.. to 'dirname XXX'
    	while [ 0 -eq 0 ] ; do	
    		beforeDotDot=`echo "$argument" | sed "s/\/\.\.$//g" 2> /dev/null`
                    if [ 0 -eq `ifEquals "$beforeDotDot" "$argument"` ] && [ 0 -eq `ifEquals "$beforeDotDot" "."` ] && [ 0 -eq `ifEquals "$beforeDotDot" ".."` ] ; then
    		    argument=`dirname "$beforeDotDot"`
    		else 
                        break
    		fi	
    	done
    
    	# replace all /./ to /
    	while [ 0 -eq 0 ] ; do	
    		testArgument=`echo "$argument" | sed 's/\/\.\//\//g' 2> /dev/null`
    		if [ -n "$testArgument" ] && [ 0 -eq `ifEquals "$argument" "$testArgument"` ] ; then
    		    	# something changed
    			argument="$testArgument"
    		else
    			break
    		fi	
    	done
    
            # remove /. a the end (if the resulting string is not zero)
    	testArgument=`echo "$argument" | sed 's/\/\.$//' 2> /dev/null`
    	if [ -n "$testArgument" ] ; then
    		argument="$testArgument"
    	fi
    
    	# replace more than 2 separators to 1
    	testArgument=`echo "$argument" | sed 's/\/\/*/\//g' 2> /dev/null`
    	if [ -n "$testArgument" ] ; then
    		argument="$testArgument"
    	fi
    	
    	echo "$argument"	
    }
    
    resolveSymlink() {  
        pathArg="$1"	
        while [ $isSymlink "$pathArg" ] ; do
            ls=`ls -ld "$pathArg"`
            link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
        
            if expr "$link" : '^/' 2> /dev/null >/dev/null; then
    		pathArg="$link"
            else
    		pathArg="`dirname "$pathArg"`"/"$link"
            fi
    	pathArg=`normalizePath "$pathArg"` 
        done
        echo "$pathArg"
    }
    
    verifyJVM() {                
        javaTryPath=`normalizePath "$1"` 
        verifyJavaHome "$javaTryPath"
        if [ $VERIFY_OK -ne $verifyResult ] ; then
    	savedResult=$verifyResult
    
        	if [ 0 -eq $isMacOSX ] ; then
            	#check private jre
    		javaTryPath="$javaTryPath""/jre"
    		verifyJavaHome "$javaTryPath"	
        	else
    		#check MacOSX Home dir
    		javaTryPath="$javaTryPath""/Home"
    		verifyJavaHome "$javaTryPath"			
    	fi	
    	
    	if [ $VERIFY_NOJAVA -eq $verifyResult ] ; then                                           
    		verifyResult=$savedResult
    	fi 
        fi
    }
    
    removeEndSlashes() {
     arg="$1"
     tryRemove=`echo "$arg" | sed 's/\/\/*$//' 2>/dev/null`
     if [ -n "$tryRemove" ] ; then
          arg="$tryRemove"
     fi
     echo "$arg"
    }
    
    checkJavaHierarchy() {
    	# return 0 on no java
    	# return 1 on jre
    	# return 2 on jdk
    
    	tryJava="$1"
    	javaHierarchy=0
    	if [ -n "$tryJava" ] ; then
    		if [ -d "$tryJava" ] || [ $isSymlink "$tryJava" ] ; then # existing directory or a isSymlink        			
    			javaLib="$tryJava"/"lib"
    	        
    			if [ -d "$javaLib" ] || [ $isSymlink "$javaLib" ] ; then
    				javaLibDtjar="$javaLib"/"dt.jar"
    				if [ -f "$javaLibDtjar" ] || [ -f "$javaLibDtjar" ] ; then
    					#definitely JDK as the JRE doesn`t have dt.jar
    					javaHierarchy=2				
    				else
    					#check if we inside JRE
    					javaLibJce="$javaLib"/"jce.jar"
    					javaLibCharsets="$javaLib"/"charsets.jar"					
    					javaLibRt="$javaLib"/"rt.jar"
    					if [ -f "$javaLibJce" ] || [ $isSymlink "$javaLibJce" ] || [ -f "$javaLibCharsets" ] || [ $isSymlink "$javaLibCharsets" ] || [ -f "$javaLibRt" ] || [ $isSymlink "$javaLibRt" ] ; then
    						javaHierarchy=1
    					fi
    					
    				fi
    			fi
    		fi
    	fi
    	if [ 0 -eq $javaHierarchy ] ; then
    		debug "... no java there"
    	elif [ 1 -eq $javaHierarchy ] ; then
    		debug "... JRE there"
    	elif [ 2 -eq $javaHierarchy ] ; then
    		debug "... JDK there"
    	fi
    }
    
    verifyJavaHome() { 
        verifyResult=$VERIFY_NOJAVA
        java=`removeEndSlashes "$1"`
        debug "... verify    : $java"    
    
        java=`resolveSymlink "$java"`    
        debug "... real path : $java"
    
        checkJavaHierarchy "$java"
    	
        if [ 0 -ne $javaHierarchy ] ; then 
    	testJVMclasspath=`escapeString "$TEST_JVM_CLASSPATH"`
    	testJVMclass=`escapeString "$TEST_JVM_CLASS"`
    
            pointer="$POSSIBLE_JAVA_EXE_SUFFIX"
            while [ -n "$pointer" ] && [ -z "$LAUNCHER_JAVA_EXE" ]; do
                arg=`echo "$pointer" | sed "s/:.*//"`
    	    back=`echo "$arg" | sed "s/\\\//\\\\\\\\\//g"`
    	    end=`echo "$pointer"       | sed "s/${back}://"`
    	    arg=`echo "$back" | sed "s/\\\\\\\\\//\\\//g"`
    	    pointer="$end"
                javaExe="$java/$arg"	    
    
                if [ -x "$javaExe" ] ; then		
                    javaExeEscaped=`escapeString "$javaExe"`
                    command="$javaExeEscaped -classpath $testJVMclasspath $testJVMclass"
    
                    debug "Executing java verification command..."
    		debug "$command"
                    output=`eval "$command" 2>/dev/null`
                    javaVersion=`echo "$output"   | sed "2d;3d;4d;5d"`
    		javaVmVersion=`echo "$output" | sed "1d;3d;4d;5d"`
    		vendor=`echo "$output"        | sed "1d;2d;4d;5d"`
    		osname=`echo "$output"        | sed "1d;2d;3d;5d"`
    		osarch=`echo "$output"        | sed "1d;2d;3d;4d"`
    
    		debug "Java :"
                    debug "       executable = {$javaExe}"	
    		debug "      javaVersion = {$javaVersion}"
    		debug "    javaVmVersion = {$javaVmVersion}"
    		debug "           vendor = {$vendor}"
    		debug "           osname = {$osname}"
    		debug "           osarch = {$osarch}"
    		comp=0
    
    		if [ -n "$javaVersion" ] && [ -n "$javaVmVersion" ] && [ -n "$vendor" ] && [ -n "$osname" ] && [ -n "$osarch" ] ; then
    		    debug "... seems to be java indeed"
    		    javaVersionEsc=`escapeBackslash "$javaVersion"`
                        javaVmVersionEsc=`escapeBackslash "$javaVmVersion"`
                        javaVersion=`awk 'END { idx = index(b,a); if(idx!=0) { print substr(b,idx,length(b)) } else { print a } }' a="$javaVersionEsc" b="$javaVmVersionEsc" < /dev/null`
    
    		    #remove build number
    		    javaVersion=`echo "$javaVersion" | sed 's/-.*$//;s/\ .*//'`
    		    verifyResult=$VERIFY_UNCOMPATIBLE
    
    	            if [ -n "$javaVersion" ] ; then
    			debug " checking java version = {$javaVersion}"
    			javaCompCounter=0
    
    			while [ $javaCompCounter -lt $JAVA_COMPATIBLE_PROPERTIES_NUMBER ] && [ -z "$LAUNCHER_JAVA_EXE" ] ; do				
    				comp=1
    				setJavaCompatibilityProperties_$javaCompCounter
    				debug "Min Java Version : $JAVA_COMP_VERSION_MIN"
    				debug "Max Java Version : $JAVA_COMP_VERSION_MAX"
    				debug "Java Vendor      : $JAVA_COMP_VENDOR"
    				debug "Java OS Name     : $JAVA_COMP_OSNAME"
    				debug "Java OS Arch     : $JAVA_COMP_OSARCH"
    
    				if [ -n "$JAVA_COMP_VERSION_MIN" ] ; then
                                        compMin=`ifVersionLess "$javaVersion" "$JAVA_COMP_VERSION_MIN"`
                                        if [ 1 -eq $compMin ] ; then
                                            comp=0
                                        fi
    				fi
    
    		                if [ -n "$JAVA_COMP_VERSION_MAX" ] ; then
                                        compMax=`ifVersionGreater "$javaVersion" "$JAVA_COMP_VERSION_MAX"`
                                        if [ 1 -eq $compMax ] ; then
                                            comp=0
                                        fi
    		                fi				
    				if [ -n "$JAVA_COMP_VENDOR" ] ; then
    					debug " checking vendor = {$vendor}, {$JAVA_COMP_VENDOR}"
    					subs=`echo "$vendor" | sed "s/${JAVA_COMP_VENDOR}//"`
    					if [ `ifEquals "$subs" "$vendor"` -eq 1 ]  ; then
    						comp=0
    						debug "... vendor incompatible"
    					fi
    				fi
    	
    				if [ -n "$JAVA_COMP_OSNAME" ] ; then
    					debug " checking osname = {$osname}, {$JAVA_COMP_OSNAME}"
    					subs=`echo "$osname" | sed "s/${JAVA_COMP_OSNAME}//"`
    					
    					if [ `ifEquals "$subs" "$osname"` -eq 1 ]  ; then
    						comp=0
    						debug "... osname incompatible"
    					fi
    				fi
    				if [ -n "$JAVA_COMP_OSARCH" ] ; then
    					debug " checking osarch = {$osarch}, {$JAVA_COMP_OSARCH}"
    					subs=`echo "$osarch" | sed "s/${JAVA_COMP_OSARCH}//"`
    					
    					if [ `ifEquals "$subs" "$osarch"` -eq 1 ]  ; then
    						comp=0
    						debug "... osarch incompatible"
    					fi
    				fi
    				if [ $comp -eq 1 ] ; then
    				        LAUNCHER_JAVA_EXE="$javaExe"
    					LAUNCHER_JAVA="$java"
    					verifyResult=$VERIFY_OK
    		    		fi
    				debug "       compatible = [$comp]"
    				javaCompCounter=`expr "$javaCompCounter" + 1`
    			done
    		    fi		    
    		fi		
                fi	    
            done
       fi
    }
    
    checkFreeSpace() {
    	size="$1"
    	path="$2"
    
    	if [ ! -d "$path" ] && [ ! $isSymlink "$path" ] ; then
    		# if checking path is not an existing directory - check its parent dir
    		path=`dirname "$path"`
    	fi
    
    	diskSpaceCheck=0
    
    	if [ 0 -eq $PERFORM_FREE_SPACE_CHECK ] ; then
    		diskSpaceCheck=1
    	else
    		# get size of the atomic entry (directory)
    		freeSpaceDirCheck="$path"/freeSpaceCheckDir
    		debug "Checking space in $path (size = $size)"
    		mkdir -p "$freeSpaceDirCheck"
    		# POSIX compatible du return size in 1024 blocks
    		du --block-size=$DEFAULT_DISK_BLOCK_SIZE "$freeSpaceDirCheck" 1>/dev/null 2>&1
    		
    		if [ $? -eq 0 ] ; then 
    			debug "    getting POSIX du with 512 bytes blocks"
    			atomicBlock=`du --block-size=$DEFAULT_DISK_BLOCK_SIZE "$freeSpaceDirCheck" | awk ' { print $A }' A=1 2>/dev/null` 
    		else
    			debug "    getting du with default-size blocks"
    			atomicBlock=`du "$freeSpaceDirCheck" | awk ' { print $A }' A=1 2>/dev/null` 
    		fi
    		rm -rf "$freeSpaceDirCheck"
    	        debug "    atomic block size : [$atomicBlock]"
    
                    isBlockNumber=`ifNumber "$atomicBlock"`
    		if [ 0 -eq $isBlockNumber ] ; then
    			out "Can\`t get disk block size"
    			exitProgram $ERROR_INPUTOUPUT
    		fi
    		requiredBlocks=`expr \( "$1" / $DEFAULT_DISK_BLOCK_SIZE \) + $atomicBlock` 1>/dev/null 2>&1
    		if [ `ifNumber $1` -eq 0 ] ; then 
    		        out "Can\`t calculate required blocks size"
    			exitProgram $ERROR_INPUTOUPUT
    		fi
    		# get free block size
    		column=4
    		df -P --block-size="$DEFAULT_DISK_BLOCK_SIZE" "$path" 1>/dev/null 2>&1
    		if [ $? -eq 0 ] ; then 
    			# gnu df, use POSIX output
    			 debug "    getting GNU POSIX df with specified block size $DEFAULT_DISK_BLOCK_SIZE"
    			 availableBlocks=`df -P --block-size="$DEFAULT_DISK_BLOCK_SIZE"  "$path" | sed "1d" | awk ' { print $A }' A=$column 2>/dev/null`
    		else 
    			# try POSIX output
    			df -P "$path" 1>/dev/null 2>&1
    			if [ $? -eq 0 ] ; then 
    				 debug "    getting POSIX df with 512 bytes blocks"
    				 availableBlocks=`df -P "$path" | sed "1d" | awk ' { print $A }' A=$column 2>/dev/null`
    			# try  Solaris df from xpg4
    			elif  [ -x /usr/xpg4/bin/df ] ; then 
    				 debug "    getting xpg4 df with default-size blocks"
    				 availableBlocks=`/usr/xpg4/bin/df -P "$path" | sed "1d" | awk ' { print $A }' A=$column 2>/dev/null`
    			# last chance to get free space
    			else		
    				 debug "    getting df with default-size blocks"
    				 availableBlocks=`df "$path" | sed "1d" | awk ' { print $A }' A=$column 2>/dev/null`
    			fi
    		fi
    		debug "    available blocks : [$availableBlocks]"
    		if [ `ifNumber "$availableBlocks"` -eq 0 ] ; then
    			out "Can\`t get the number of the available blocks on the system"
    			exitProgram $ERROR_INPUTOUTPUT
    		fi
    		
    		# compare
                    debug "    required  blocks : [$requiredBlocks]"
    
    		if [ $availableBlocks -gt $requiredBlocks ] ; then
    			debug "... disk space check OK"
    			diskSpaceCheck=1
    		else 
    		        debug "... disk space check FAILED"
    		fi
    	fi
    	if [ 0 -eq $diskSpaceCheck ] ; then
    		mbDownSize=`expr "$size" / 1024 / 1024`
    		mbUpSize=`expr "$size" / 1024 / 1024 + 1`
    		mbSize=`expr "$mbDownSize" \* 1024 \* 1024`
    		if [ $size -ne $mbSize ] ; then	
    			mbSize="$mbUpSize"
    		else
    			mbSize="$mbDownSize"
    		fi
    		
    		message "$MSG_ERROR_FREESPACE" "$mbSize" "$ARG_TEMPDIR"	
    		exitProgram $ERROR_FREESPACE
    	fi
    }
    
    prepareClasspath() {
        debug "Processing external jars ..."
        processJarsClasspath
     
        LAUNCHER_CLASSPATH=""
        if [ -n "$JARS_CLASSPATH" ] ; then
    		if [ -z "$LAUNCHER_CLASSPATH" ] ; then
    			LAUNCHER_CLASSPATH="$JARS_CLASSPATH"
    		else
    			LAUNCHER_CLASSPATH="$LAUNCHER_CLASSPATH":"$JARS_CLASSPATH"
    		fi
        fi
    
        if [ -n "$PREPEND_CP" ] ; then
    	debug "Appending classpath with [$PREPEND_CP]"
    	PREPEND_CP=`resolveString "$PREPEND_CP"`
    
    	if [ -z "$LAUNCHER_CLASSPATH" ] ; then
    		LAUNCHER_CLASSPATH="$PREPEND_CP"		
    	else
    		LAUNCHER_CLASSPATH="$PREPEND_CP":"$LAUNCHER_CLASSPATH"	
    	fi
        fi
        if [ -n "$APPEND_CP" ] ; then
    	debug "Appending classpath with [$APPEND_CP]"
    	APPEND_CP=`resolveString "$APPEND_CP"`
    	if [ -z "$LAUNCHER_CLASSPATH" ] ; then
    		LAUNCHER_CLASSPATH="$APPEND_CP"	
    	else
    		LAUNCHER_CLASSPATH="$LAUNCHER_CLASSPATH":"$APPEND_CP"	
    	fi
        fi
        debug "Launcher Classpath : $LAUNCHER_CLASSPATH"
    }
    
    resolvePropertyStrings() {
    	args="$1"
    	escapeReplacedString="$2"
    	propertyStart=`echo "$args" | sed "s/^.*\\$P{//"`
    	propertyValue=""
    	propertyName=""
    
    	#Resolve i18n strings and properties
    	if [ 0 -eq `ifEquals "$propertyStart" "$args"` ] ; then
    		propertyName=`echo "$propertyStart" |  sed "s/}.*//" 2>/dev/null`
    		if [ -n "$propertyName" ] ; then
    			propertyValue=`getMessage "$propertyName"`
    
    			if [ 0 -eq `ifEquals "$propertyValue" "$propertyName"` ] ; then				
    				propertyName="\$P{$propertyName}"
    				args=`replaceString "$args" "$propertyName" "$propertyValue" "$escapeReplacedString"`
    			fi
    		fi
    	fi
    			
    	echo "$args"
    }
    
    
    resolveLauncherSpecialProperties() {
    	args="$1"
    	escapeReplacedString="$2"
    	propertyValue=""
    	propertyName=""
    	propertyStart=`echo "$args" | sed "s/^.*\\$L{//"`
    
    	
            if [ 0 -eq `ifEquals "$propertyStart" "$args"` ] ; then
     		propertyName=`echo "$propertyStart" |  sed "s/}.*//" 2>/dev/null`
    		
    
    		if [ -n "$propertyName" ] ; then
    			case "$propertyName" in
    		        	"nbi.launcher.tmp.dir")                        		
    					propertyValue="$LAUNCHER_EXTRACT_DIR"
    					;;
    				"nbi.launcher.java.home")	
    					propertyValue="$LAUNCHER_JAVA"
    					;;
    				"nbi.launcher.user.home")
    					propertyValue="$HOME"
    					;;
    				"nbi.launcher.parent.dir")
    					propertyValue="$LAUNCHER_DIR"
    					;;
    				*)
    					propertyValue="$propertyName"
    					;;
    			esac
    			if [ 0 -eq `ifEquals "$propertyValue" "$propertyName"` ] ; then				
    				propertyName="\$L{$propertyName}"
    				args=`replaceString "$args" "$propertyName" "$propertyValue" "$escapeReplacedString"`
    			fi      
    		fi
    	fi            
    	echo "$args"
    }
    
    resolveString() {
     	args="$1"
    	escapeReplacedString="$2"
    	last="$args"
    	repeat=1
    
    	while [ 1 -eq $repeat ] ; do
    		repeat=1
    		args=`resolvePropertyStrings "$args" "$escapeReplacedString"`
    		args=`resolveLauncherSpecialProperties "$args" "$escapeReplacedString"`		
    		if [ 1 -eq `ifEquals "$last" "$args"` ] ; then
    		    repeat=0
    		fi
    		last="$args"
    	done
    	echo "$args"
    }
    
    replaceString() {
    	initialString="$1"	
    	fromString="$2"
    	toString="$3"
    	if [ -n "$4" ] && [ 0 -eq `ifEquals "$4" "false"` ] ; then
    		toString=`escapeString "$toString"`
    	fi
    	fromString=`echo "$fromString" | sed "s/\\\//\\\\\\\\\//g" 2>/dev/null`
    	toString=`echo "$toString" | sed "s/\\\//\\\\\\\\\//g" 2>/dev/null`
            replacedString=`echo "$initialString" | sed "s/${fromString}/${toString}/g" 2>/dev/null`        
    	echo "$replacedString"
    }
    
    prepareJVMArguments() {
        debug "Prepare JVM arguments... "    
    
        jvmArgCounter=0
        debug "... resolving string : $LAUNCHER_JVM_ARGUMENTS"
        LAUNCHER_JVM_ARGUMENTS=`resolveString "$LAUNCHER_JVM_ARGUMENTS" true`
        debug "... resolved  string :  $LAUNCHER_JVM_ARGUMENTS"
        while [ $jvmArgCounter -lt $JVM_ARGUMENTS_NUMBER ] ; do		
    	 argumentVar="$""JVM_ARGUMENT_$jvmArgCounter"
             arg=`eval "echo \"$argumentVar\""`
    	 debug "... jvm argument [$jvmArgCounter] [initial]  : $arg"
    	 arg=`resolveString "$arg"`
    	 debug "... jvm argument [$jvmArgCounter] [resolved] : $arg"
    	 arg=`escapeString "$arg"`
    	 debug "... jvm argument [$jvmArgCounter] [escaped] : $arg"
    	 LAUNCHER_JVM_ARGUMENTS="$LAUNCHER_JVM_ARGUMENTS $arg"	
     	 jvmArgCounter=`expr "$jvmArgCounter" + 1`
        done                
        debug "Final JVM arguments : $LAUNCHER_JVM_ARGUMENTS"            
    }
    
    prepareAppArguments() {
        debug "Prepare Application arguments... "    
    
        appArgCounter=0
        debug "... resolving string : $LAUNCHER_APP_ARGUMENTS"
        LAUNCHER_APP_ARGUMENTS=`resolveString "$LAUNCHER_APP_ARGUMENTS" true`
        debug "... resolved  string :  $LAUNCHER_APP_ARGUMENTS"
        while [ $appArgCounter -lt $APP_ARGUMENTS_NUMBER ] ; do		
    	 argumentVar="$""APP_ARGUMENT_$appArgCounter"
             arg=`eval "echo \"$argumentVar\""`
    	 debug "... app argument [$appArgCounter] [initial]  : $arg"
    	 arg=`resolveString "$arg"`
    	 debug "... app argument [$appArgCounter] [resolved] : $arg"
    	 arg=`escapeString "$arg"`
    	 debug "... app argument [$appArgCounter] [escaped] : $arg"
    	 LAUNCHER_APP_ARGUMENTS="$LAUNCHER_APP_ARGUMENTS $arg"	
     	 appArgCounter=`expr "$appArgCounter" + 1`
        done
        debug "Final application arguments : $LAUNCHER_APP_ARGUMENTS"            
    }
    
    
    runCommand() {
    	cmd="$1"
    	debug "Running command : $cmd"
    	if [ -n "$OUTPUT_FILE" ] ; then
    		#redirect all stdout and stderr from the running application to the file
    		eval "$cmd" >> "$OUTPUT_FILE" 2>&1
    	elif [ 1 -eq $SILENT_MODE ] ; then
    		# on silent mode redirect all out/err to null
    		eval "$cmd" > /dev/null 2>&1	
    	elif [ 0 -eq $USE_DEBUG_OUTPUT ] ; then
    		# redirect all output to null
    		# do not redirect errors there but show them in the shell output
    		eval "$cmd" > /dev/null	
    	else
    		# using debug output to the shell
    		# not a silent mode but a verbose one
    		eval "$cmd"
    	fi
    	return $?
    }
    
    executeMainClass() {
    	prepareClasspath
    	prepareJVMArguments
    	prepareAppArguments
    	debug "Running main jar..."
    	message "$MSG_RUNNING"
    	classpathEscaped=`escapeString "$LAUNCHER_CLASSPATH"`
    	mainClassEscaped=`escapeString "$MAIN_CLASS"`
    	launcherJavaExeEscaped=`escapeString "$LAUNCHER_JAVA_EXE"`
    	tmpdirEscaped=`escapeString "$LAUNCHER_JVM_TEMP_DIR"`
    	
    	command="$launcherJavaExeEscaped $LAUNCHER_JVM_ARGUMENTS -Djava.io.tmpdir=$tmpdirEscaped -classpath $classpathEscaped $mainClassEscaped $LAUNCHER_APP_ARGUMENTS"
    
    	debug "Running command : $command"
    	runCommand "$command"
    	exitCode=$?
    	debug "... java process finished with code $exitCode"
    	exitProgram $exitCode
    }
    
    escapeString() {
    	echo "$1" | sed "s/\\\/\\\\\\\/g;s/\ /\\\\ /g;s/\"/\\\\\"/g;s/(/\\\\\(/g;s/)/\\\\\)/g;" # escape spaces, commas and parentheses
    }
    
    getMessage() {
            getLocalizedMessage_$LAUNCHER_LOCALE $@
    }
    
    POSSIBLE_JAVA_ENV="JAVA:JAVA_HOME:JAVAHOME:JAVA_PATH:JAVAPATH:JDK:JDK_HOME:JDKHOME:ANT_JAVA:"
    POSSIBLE_JAVA_EXE_SUFFIX_SOLARIS="bin/java:bin/sparcv9/java:"
    POSSIBLE_JAVA_EXE_SUFFIX_COMMON="bin/java:"
    
    
    ################################################################################
    # Added by the bundle builder
    FILE_BLOCK_SIZE=1024
    
    JAVA_LOCATION_0_TYPE=1
    JAVA_LOCATION_0_PATH="/usr/java*"
    JAVA_LOCATION_1_TYPE=1
    JAVA_LOCATION_1_PATH="/usr/java/*"
    JAVA_LOCATION_2_TYPE=1
    JAVA_LOCATION_2_PATH="/usr/jdk*"
    JAVA_LOCATION_3_TYPE=1
    JAVA_LOCATION_3_PATH="/usr/jdk/*"
    JAVA_LOCATION_4_TYPE=1
    JAVA_LOCATION_4_PATH="/usr/j2se"
    JAVA_LOCATION_5_TYPE=1
    JAVA_LOCATION_5_PATH="/usr/j2se/*"
    JAVA_LOCATION_6_TYPE=1
    JAVA_LOCATION_6_PATH="/usr/j2sdk"
    JAVA_LOCATION_7_TYPE=1
    JAVA_LOCATION_7_PATH="/usr/j2sdk/*"
    JAVA_LOCATION_8_TYPE=1
    JAVA_LOCATION_8_PATH="/usr/java/jdk*"
    JAVA_LOCATION_9_TYPE=1
    JAVA_LOCATION_9_PATH="/usr/java/jdk/*"
    JAVA_LOCATION_10_TYPE=1
    JAVA_LOCATION_10_PATH="/usr/jdk/instances"
    JAVA_LOCATION_11_TYPE=1
    JAVA_LOCATION_11_PATH="/usr/jdk/instances/*"
    JAVA_LOCATION_12_TYPE=1
    JAVA_LOCATION_12_PATH="/usr/local/java"
    JAVA_LOCATION_13_TYPE=1
    JAVA_LOCATION_13_PATH="/usr/local/java/*"
    JAVA_LOCATION_14_TYPE=1
    JAVA_LOCATION_14_PATH="/usr/local/jdk*"
    JAVA_LOCATION_15_TYPE=1
    JAVA_LOCATION_15_PATH="/usr/local/jdk/*"
    JAVA_LOCATION_16_TYPE=1
    JAVA_LOCATION_16_PATH="/usr/local/j2se"
    JAVA_LOCATION_17_TYPE=1
    JAVA_LOCATION_17_PATH="/usr/local/j2se/*"
    JAVA_LOCATION_18_TYPE=1
    JAVA_LOCATION_18_PATH="/usr/local/j2sdk"
    JAVA_LOCATION_19_TYPE=1
    JAVA_LOCATION_19_PATH="/usr/local/j2sdk/*"
    JAVA_LOCATION_20_TYPE=1
    JAVA_LOCATION_20_PATH="/opt/java*"
    JAVA_LOCATION_21_TYPE=1
    JAVA_LOCATION_21_PATH="/opt/java/*"
    JAVA_LOCATION_22_TYPE=1
    JAVA_LOCATION_22_PATH="/opt/jdk*"
    JAVA_LOCATION_23_TYPE=1
    JAVA_LOCATION_23_PATH="/opt/jdk/*"
    JAVA_LOCATION_24_TYPE=1
    JAVA_LOCATION_24_PATH="/opt/j2sdk"
    JAVA_LOCATION_25_TYPE=1
    JAVA_LOCATION_25_PATH="/opt/j2sdk/*"
    JAVA_LOCATION_26_TYPE=1
    JAVA_LOCATION_26_PATH="/opt/j2se"
    JAVA_LOCATION_27_TYPE=1
    JAVA_LOCATION_27_PATH="/opt/j2se/*"
    JAVA_LOCATION_28_TYPE=1
    JAVA_LOCATION_28_PATH="/usr/lib/jvm"
    JAVA_LOCATION_29_TYPE=1
    JAVA_LOCATION_29_PATH="/usr/lib/jvm/*"
    JAVA_LOCATION_30_TYPE=1
    JAVA_LOCATION_30_PATH="/usr/lib/jdk*"
    JAVA_LOCATION_31_TYPE=1
    JAVA_LOCATION_31_PATH="/export/jdk*"
    JAVA_LOCATION_32_TYPE=1
    JAVA_LOCATION_32_PATH="/export/jdk/*"
    JAVA_LOCATION_33_TYPE=1
    JAVA_LOCATION_33_PATH="/export/java"
    JAVA_LOCATION_34_TYPE=1
    JAVA_LOCATION_34_PATH="/export/java/*"
    JAVA_LOCATION_35_TYPE=1
    JAVA_LOCATION_35_PATH="/export/j2se"
    JAVA_LOCATION_36_TYPE=1
    JAVA_LOCATION_36_PATH="/export/j2se/*"
    JAVA_LOCATION_37_TYPE=1
    JAVA_LOCATION_37_PATH="/export/j2sdk"
    JAVA_LOCATION_38_TYPE=1
    JAVA_LOCATION_38_PATH="/export/j2sdk/*"
    JAVA_LOCATION_NUMBER=39
    
    LAUNCHER_LOCALES_NUMBER=4
    LAUNCHER_LOCALE_NAME_0=""
    LAUNCHER_LOCALE_NAME_1="pt_BR"
    LAUNCHER_LOCALE_NAME_2="zh_CN"
    LAUNCHER_LOCALE_NAME_3="ja"
    
    getLocalizedMessage_() {
            arg=$1
            shift
            case $arg in
            "nlu.freespace")
                    printf "There is not enough free disk space to extract installation data\n$1 MB of free disk space is required in a temporary folder.\nClean up the disk space and run installer again. You can specify a temporary folder with sufficient disk space using $2 installer argument\n"
                    ;;
            "nlu.prepare.jvm")
                    printf "Preparing bundled JVM ...\n"
                    ;;
            "nlu.error.verify.bundled.jvm")
                    printf "Cannot verify bundled JVM, try to search JVM on the system\n"
                    ;;
            "nlu.cannot.unpack.jvm.file")
                    printf "Cannot unpack file $1\n"
                    ;;
            "nlu.arg.cpp")
                    printf "\\t$1 <cp>\\tPrepend classpath with <cp>\n"
                    ;;
            "nlu.arg.tempdir")
                    printf "\\t$1\\t<dir>\\tUse <dir> for extracting temporary data\n"
                    ;;
            "nlu.arg.locale")
                    printf "\\t$1\\t<locale>\\tOverride default locale with specified <locale>\n"
                    ;;
            "nlu.arg.cpa")
                    printf "\\t$1 <cp>\\tAppend classpath with <cp>\n"
                    ;;
            "nlu.cannot.extract.bundled.jvm")
                    printf "Cannot extract bundled JVM\n"
                    ;;
            "nlu.missing.external.resource")
                    printf "Can\`t run NetBeans Installer.\nAn external file with necessary data is required but missing:\n$1\n"
                    ;;
            "nlu.jvm.usererror")
                    printf "Java Runtime Environment (JRE) was not found at the specified location $1\n"
                    ;;
            "nlu.java.application.name.macosx")
                    printf "NetBeans IDE Installer\n"
                    ;;
            "nlu.msg.usage")
                    printf "\nUsage:\n"
                    ;;
            "nlu.arg.silent")
                    printf "\\t$1\\t\\tRun installer silently\n"
                    ;;
            "nlu.cannot.create.tmpdir")
                    printf "Cannot create temporary directory $1\n"
                    ;;
            "nlu.jvm.uncompatible")
                    printf "Unsupported JVM version at $1.\nTry to specify another JVM location using parameter $2\n"
                    ;;
            "nlu.arg.verbose")
                    printf "\\t$1\\t\\tUse verbose output\n"
                    ;;
            "nlu.jvm.notfoundmessage")
                    printf "Java SE Development Kit (JDK) was not found on this computer\nJDK 6 is required for installing the NetBeans IDE. Make sure that the JDK is properly installed and run installer again.\nYou can specify valid JDK location using $1 installer argument.\n\nTo download the JDK, visit http://java.sun.com/javase/downloads\n"
                    ;;
            "nlu.starting")
                    printf "Configuring the installer...\n"
                    ;;
            "nlu.arg.extract")
                    printf "\\t$1\\t[dir]\\tExtract all bundled data to <dir>.\n\\t\\t\\t\\tIf <dir> is not specified then extract to the current directory\n"
                    ;;
            "nlu.arg.disable.space.check")
                    printf "\\t$1\\t\\tDisable free space check\n"
                    ;;
            "nlu.integrity")
                    printf "\nInstaller file $1 seems to be corrupted\n"
                    ;;
            "nlu.running")
                    printf "Running the installer wizard...\n"
                    ;;
            "nlu.arg.help")
                    printf "\\t$1\\t\\tShow this help\n"
                    ;;
            "nlu.arg.javahome")
                    printf "\\t$1\\t<dir>\\tUsing java from <dir> for running application\n"
                    ;;
            "nlu.extracting")
                    printf "Extracting installation data...\n"
                    ;;
            "nlu.arg.output")
                    printf "\\t$1\\t<out>\\tRedirect all output to file <out>\n"
                    ;;
            "nlu.jvm.search")
                    printf "Searching for JVM on the system...\n"
                    ;;
            *)
                    printf "$arg\n"
                    ;;
            esac
    }
    
    getLocalizedMessage_pt_BR() {
            arg=$1
            shift
            case $arg in
            "nlu.freespace")
                    printf "\516\303\243\557\440\550\303\241\440\545\563\560\541\303\247\557\440\545\555\440\544\551\563\543\557\440\554\551\566\562\545\440\563\565\546\551\543\551\545\556\564\545\440\560\541\562\541\440\545\570\564\562\541\551\562\440\557\563\440\544\541\544\557\563\440\544\541\440\551\556\563\564\541\554\541\303\247\303\243\557\412$1\515\502\440\544\545\440\545\563\560\541\303\247\557\440\554\551\566\562\545\440\303\251\440\556\545\543\545\563\563\303\241\562\551\557\440\545\555\440\565\555\541\440\560\541\563\564\541\440\564\545\555\560\557\562\303\241\562\551\541\456\412\514\551\555\560\545\440\545\563\560\541\303\247\557\440\545\555\440\544\551\563\543\557\440\545\440\545\570\545\543\565\564\545\440\557\440\551\556\563\564\541\554\541\544\557\562\440\556\557\566\541\555\545\556\564\545\456\440\526\557\543\303\252\440\560\557\544\545\440\545\563\560\545\543\551\546\551\543\541\562\440\565\555\541\440\560\541\563\564\541\440\564\545\555\560\557\562\303\241\562\551\541\440\543\557\555\440\545\563\560\541\303\247\557\440\545\555\440\544\551\563\543\557\440\563\565\546\551\543\551\545\556\564\545\440\565\564\551\554\551\572\541\556\544\557\440\557\440\541\562\547\565\555\545\556\564\557\440\544\557\440\551\556\563\564\541\554\541\544\557\562\440$2\n"
                    ;;
            "nlu.prepare.jvm")
                    printf "Preparando JVM embutida...\n"
                    ;;
            "nlu.error.verify.bundled.jvm")
                    printf "\516\303\243\557\440\560\303\264\544\545\440\566\545\562\551\546\551\543\541\562\440\541\440\512\526\515\440\545\555\542\565\564\551\544\541\454\440\546\541\566\557\562\440\564\545\556\564\541\562\440\560\562\557\543\565\562\541\562\440\560\557\562\440\565\555\541\440\512\526\515\440\544\551\562\545\564\541\555\545\556\564\545\440\556\557\440\563\551\563\564\545\555\541\n"
                    ;;
            "nlu.cannot.unpack.jvm.file")
                    printf "\516\303\243\557\440\560\303\264\544\545\440\544\545\563\545\555\560\541\543\557\564\541\562\440\557\440\541\562\561\565\551\566\557\440$1\n"
                    ;;
            "nlu.arg.cpp")
                    printf "$1 <cp>\\tColocar no classpath com <cp>\n"
                    ;;
            "nlu.arg.tempdir")
                    printf "$1\474\544\551\562\476\411\525\564\551\554\551\572\541\562\440\474\544\551\562\476\440\560\541\562\541\440\545\570\564\562\541\303\247\303\243\557\440\544\545\440\544\541\544\557\563\440\564\545\555\560\557\562\303\241\562\551\557\563\n"
                    ;;
            "nlu.arg.locale")
                    printf "$1\474\554\557\543\541\554\476\411\523\557\542\562\545\563\543\562\545\566\545\562\440\557\440\554\557\543\541\554\440\560\541\544\562\303\243\557\440\543\557\555\440\557\440\545\563\560\545\543\551\546\551\543\541\544\557\440\474\554\557\543\541\554\476\n"
                    ;;
            "nlu.arg.cpa")
                    printf "$1 <cp>\\tAdicionar classpath com <cp>\n"
                    ;;
            "nlu.cannot.extract.bundled.jvm")
                    printf "\516\303\243\557\440\560\303\264\544\545\440\545\570\564\562\541\551\562\440\541\440\512\526\515\440\545\555\542\565\564\551\544\541\456\n"
                    ;;
            "nlu.missing.external.resource")
                    printf "\516\303\242\557\440\560\557\544\545\440\545\570\545\543\565\564\541\562\440\557\440\551\556\563\564\541\554\541\544\557\562\440\544\557\440\516\545\564\502\545\541\556\563\456\412\525\555\440\541\562\561\565\551\566\557\440\545\570\564\545\562\556\557\440\543\557\555\440\544\541\544\557\563\440\556\545\543\545\563\563\303\241\562\551\557\563\440\303\251\440\557\542\562\551\547\541\564\303\263\562\551\557\440\555\541\563\440\546\541\554\564\541\556\544\557\472\412$1\n"
                    ;;
            "nlu.jvm.usererror")
                    printf "\512\541\566\541\440\522\565\556\564\551\555\545\440\505\556\566\551\562\557\556\555\545\556\564\440\450\512\522\505\451\440\556\303\243\557\440\546\557\551\440\545\556\543\557\556\564\562\541\544\557\440\556\557\440\554\557\543\541\554\440\545\563\560\545\543\551\546\551\543\541\544\557\440$1\n"
                    ;;
            "nlu.java.application.name.macosx")
                    printf "NetBeans IDE Installer\n"
                    ;;
            "nlu.msg.usage")
                    printf "\412\525\564\551\554\551\572\541\303\247\303\243\557\472\n"
                    ;;
            "nlu.arg.silent")
                    printf "\\t$1\\t\\tExecutar instalador silenciosamente\n"
                    ;;
            "nlu.cannot.create.tmpdir")
                    printf "\516\303\243\557\440\560\557\544\545\440\543\562\551\541\562\440\544\551\562\545\564\303\263\562\551\557\440\564\545\555\560\557\562\303\241\562\551\557\440$1\n"
                    ;;
            "nlu.jvm.uncompatible")
                    printf "\526\545\562\563\303\243\557\440\512\526\515\440\556\303\243\557\440\563\565\560\557\562\564\541\544\541\440\545\555\440$1\412\524\545\556\564\545\440\545\563\560\545\543\551\546\551\543\541\562\440\557\565\564\562\541\440\554\557\543\541\554\551\572\541\303\247\303\243\557\440\544\545\440\512\526\515\440\565\564\551\554\551\572\541\556\544\557\440\557\440\560\541\562\541\555\545\564\562\557\440$2\n"
                    ;;
            "nlu.arg.verbose")
                    printf "$1\411\525\564\551\554\551\572\541\562\440\566\551\563\565\541\554\551\572\541\303\247\303\243\557\440\544\545\440\563\541\303\255\544\541\n"
                    ;;
            "nlu.jvm.notfoundmessage")
                    printf "\512\541\566\541\440\523\505\440\504\545\566\545\554\557\560\555\545\556\564\440\513\551\564\440\450\512\504\513\451\440\556\303\243\557\440\546\557\551\440\545\556\543\557\556\564\562\541\544\557\440\556\545\563\564\545\440\543\557\555\560\565\564\541\544\557\562\440\512\504\513\440\466\440\557\565\440\512\504\513\440\465\440\563\303\243\557\440\556\545\543\545\563\563\303\241\562\551\557\563\440\560\541\562\541\440\551\556\563\564\541\554\541\303\247\303\243\557\440\544\557\440\511\504\505\440\516\545\564\502\545\541\556\563\456\440\501\563\563\545\547\565\562\545\440\561\565\545\440\557\440\512\504\513\440\545\563\564\303\241\440\551\556\563\564\541\554\541\544\557\440\545\440\545\570\545\543\565\564\545\440\541\440\551\556\563\564\541\554\541\303\247\303\243\557\440\556\557\566\541\555\545\556\564\545\456\412\526\557\543\303\252\440\560\557\544\545\440\545\563\560\545\543\551\546\551\543\541\562\440\541\440\554\557\543\541\554\551\572\541\303\247\303\243\557\440\544\557\440\512\504\513\440\565\564\551\554\551\572\541\556\544\557\440\557\440\541\562\547\565\555\545\556\564\557\440\544\557\440\551\556\563\564\541\554\541\544\557\562\440$1\412\412\520\541\562\541\440\544\557\567\556\554\557\541\544\440\544\557\440\512\504\513\454\440\566\551\563\551\564\545\440\550\564\564\560\472\457\457\552\541\566\541\456\563\565\556\456\543\557\555\457\552\541\566\541\563\545\457\544\557\567\556\554\557\541\544\563\n"
                    ;;
            "nlu.starting")
                    printf "Configurando o instalador ...\n"
                    ;;
            "nlu.arg.extract")
                    printf "$1\533\544\551\562\535\411\505\570\564\562\541\551\562\440\564\557\544\557\563\440\544\541\544\557\563\440\545\555\560\541\543\557\564\541\544\557\563\440\560\541\562\541\440\474\544\551\562\476\456\412\411\411\411\411\523\545\440\474\544\551\562\476\440\556\303\243\557\440\545\563\560\545\543\551\546\551\543\541\544\557\440\545\556\564\303\243\557\440\545\570\564\562\541\551\562\440\556\557\440\544\551\562\545\564\303\263\562\551\557\440\543\557\562\562\545\556\564\545\n"
                    ;;
            "nlu.arg.disable.space.check")
                    printf "$1\411\504\545\563\541\542\551\554\551\564\541\562\440\566\545\562\546\551\543\541\303\247\303\243\557\440\544\545\440\545\563\560\541\303\247\557\440\545\555\440\544\551\563\543\557\n"
                    ;;
            "nlu.integrity")
                    printf "\nO arquivo do instalador $1 parece estar corrompido\n"
                    ;;
            "nlu.running")
                    printf "Executando o assistente do instalador...\n"
                    ;;
            "nlu.arg.help")
                    printf "$1\\t\\tExibir esta ajuda\n"
                    ;;
            "nlu.arg.javahome")
                    printf "$1\474\544\551\562\476\411\525\564\551\554\551\572\541\556\544\557\440\552\541\566\541\440\544\545\440\474\544\551\562\476\440\560\541\562\541\440\545\570\545\543\565\303\247\303\243\557\440\544\557\440\541\560\554\551\543\541\564\551\566\557\n"
                    ;;
            "nlu.extracting")
                    printf "\505\570\564\562\541\551\556\544\557\440\544\541\544\557\563\440\560\541\562\541\440\551\556\563\564\541\554\541\303\247\303\243\557\456\456\456\n"
                    ;;
            "nlu.arg.output")
                    printf "$1\474\557\565\564\476\411\522\545\544\551\562\545\543\551\557\556\541\562\440\564\557\544\541\563\440\563\541\303\255\544\541\563\440\560\541\562\541\440\557\440\541\562\561\565\551\566\557\440\474\557\565\564\476\n"
                    ;;
            "nlu.jvm.search")
                    printf "Procurando por um JVM no sistema...\n"
                    ;;
            *)
                    printf "$arg\n"
                    ;;
            esac
    }
    
    getLocalizedMessage_zh_CN() {
            arg=$1
            shift
            case $arg in
            "nlu.freespace")
                    printf "\346\262\241\346\234\211\350\266\263\345\244\237\347\232\204\345\217\257\347\224\250\347\241\254\347\233\230\347\251\272\351\227\264\346\235\245\350\247\243\345\216\213\347\274\251\345\256\211\350\243\205\346\225\260\346\215\256\412\344\270\264\346\227\266\346\226\207\344\273\266\345\244\271\344\270\255\351\234\200\350\246\201\440$1\515\502\440\347\232\204\345\217\257\347\224\250\347\241\254\347\233\230\347\251\272\351\227\264\343\200\202\412\350\257\267\346\270\205\347\220\206\347\241\254\347\233\230\347\251\272\351\227\264\357\274\214\347\204\266\345\220\216\345\206\215\346\254\241\350\277\220\350\241\214\345\256\211\350\243\205\347\250\213\345\272\217\343\200\202\346\202\250\345\217\257\344\273\245\344\275\277\347\224\250\440$2\345\256\211\350\243\205\347\250\213\345\272\217\345\217\202\346\225\260\346\235\245\346\214\207\345\256\232\344\270\200\344\270\252\345\205\267\346\234\211\350\266\263\345\244\237\347\241\254\347\233\230\347\251\272\351\227\264\347\232\204\344\270\264\346\227\266\346\226\207\344\273\266\345\244\271\n"
                    ;;
            "nlu.prepare.jvm")
                    printf "\346\255\243\345\234\250\345\207\206\345\244\207\346\215\206\347\273\221\347\232\204\440\512\526\515\456\456\456\n"
                    ;;
            "nlu.error.verify.bundled.jvm")
                    printf "\346\227\240\346\263\225\351\252\214\350\257\201\346\215\206\347\273\221\347\232\204\440\512\526\515\357\274\214\350\257\267\345\260\235\350\257\225\345\234\250\347\263\273\347\273\237\344\270\255\346\220\234\347\264\242\440\512\526\515\n"
                    ;;
            "nlu.cannot.unpack.jvm.file")
                    printf "\346\227\240\346\263\225\350\247\243\345\216\213\347\274\251\346\226\207\344\273\266\440$1\n"
                    ;;
            "nlu.arg.cpp")
                    printf "\411$1\474\543\560\476\411\345\260\206\440\474\543\560\476\440\347\275\256\344\272\216\347\261\273\350\267\257\345\276\204\344\271\213\345\211\215\n"
                    ;;
            "nlu.arg.tempdir")
                    printf "\411$1\474\544\551\562\476\411\344\275\277\347\224\250\440\474\544\551\562\476\440\350\247\243\345\216\213\347\274\251\344\270\264\346\227\266\346\225\260\346\215\256\n"
                    ;;
            "nlu.arg.locale")
                    printf "\411$1\474\554\557\543\541\554\545\476\411\344\275\277\347\224\250\346\214\207\345\256\232\347\232\204\440\474\554\557\543\541\554\545\476\440\350\246\206\347\233\226\347\274\272\347\234\201\347\232\204\350\257\255\350\250\200\347\216\257\345\242\203\n"
                    ;;
            "nlu.arg.cpa")
                    printf "\411$1\474\543\560\476\411\345\260\206\440\474\543\560\476\440\347\275\256\344\272\216\347\261\273\350\267\257\345\276\204\344\271\213\345\220\216\n"
                    ;;
            "nlu.cannot.extract.bundled.jvm")
                    printf "\346\227\240\346\263\225\350\247\243\345\216\213\347\274\251\346\215\206\347\273\221\347\232\204\440\512\526\515\n"
                    ;;
            "nlu.missing.external.resource")
                    printf "\346\227\240\346\263\225\350\277\220\350\241\214\440\516\545\564\502\545\541\556\563\440\345\256\211\350\243\205\347\250\213\345\272\217\343\200\202\412\351\234\200\350\246\201\344\270\200\344\270\252\345\214\205\345\220\253\345\277\205\351\234\200\346\225\260\346\215\256\347\232\204\345\244\226\351\203\250\346\226\207\344\273\266\357\274\214\344\275\206\346\230\257\347\274\272\345\260\221\350\257\245\346\226\207\344\273\266\357\274\232\412$1\n"
                    ;;
            "nlu.jvm.usererror")
                    printf "\345\234\250\346\214\207\345\256\232\347\232\204\344\275\215\347\275\256\440$1\346\211\276\344\270\215\345\210\260\440\512\541\566\541\440\522\565\556\564\551\555\545\440\505\556\566\551\562\557\556\555\545\556\564\440\450\512\522\505\451\n"
                    ;;
            "nlu.java.application.name.macosx")
                    printf "\516\545\564\502\545\541\556\563\440\511\504\505\440\345\256\211\350\243\205\347\250\213\345\272\217\n"
                    ;;
            "nlu.msg.usage")
                    printf "\412\347\224\250\346\263\225\357\274\232\n"
                    ;;
            "nlu.arg.silent")
                    printf "\411$1\411\345\234\250\346\227\240\346\217\220\347\244\272\346\250\241\345\274\217\344\270\213\350\277\220\350\241\214\345\256\211\350\243\205\347\250\213\345\272\217\n"
                    ;;
            "nlu.cannot.create.tmpdir")
                    printf "\346\227\240\346\263\225\345\210\233\345\273\272\344\270\264\346\227\266\347\233\256\345\275\225\440$1\n"
                    ;;
            "nlu.jvm.uncompatible")
                    printf "\344\275\215\344\272\216\440$1\347\232\204\440\512\526\515\440\347\211\210\346\234\254\344\270\215\345\217\227\346\224\257\346\214\201\343\200\202\412\350\257\267\345\260\235\350\257\225\344\275\277\347\224\250\345\217\202\346\225\260\440$2\346\235\245\346\214\207\345\256\232\345\205\266\344\273\226\347\232\204\440\512\526\515\440\344\275\215\347\275\256\n"
                    ;;
            "nlu.arg.verbose")
                    printf "\411$1\411\344\275\277\347\224\250\350\257\246\347\273\206\350\276\223\345\207\272\n"
                    ;;
            "nlu.jvm.notfoundmessage")
                    printf "\345\234\250\346\255\244\350\256\241\347\256\227\346\234\272\344\270\255\346\211\276\344\270\215\345\210\260\440\512\541\566\541\440\523\505\440\504\545\566\545\554\557\560\555\545\556\564\440\513\551\564\440\450\512\504\513\451\412\351\234\200\350\246\201\440\512\504\513\440\466\440\346\211\215\350\203\275\345\256\211\350\243\205\440\516\545\564\502\545\541\556\563\440\511\504\505\343\200\202\350\257\267\347\241\256\344\277\235\346\255\243\347\241\256\345\256\211\350\243\205\344\272\206\440\512\504\513\357\274\214\347\204\266\345\220\216\351\207\215\346\226\260\350\277\220\350\241\214\345\256\211\350\243\205\347\250\213\345\272\217\343\200\202\412\346\202\250\345\217\257\344\273\245\344\275\277\347\224\250\440$1\345\256\211\350\243\205\347\250\213\345\272\217\345\217\202\346\225\260\346\235\245\346\214\207\345\256\232\346\234\211\346\225\210\347\232\204\440\512\504\513\440\344\275\215\347\275\256\343\200\202\412\412\350\246\201\344\270\213\350\275\275\440\512\504\513\357\274\214\350\257\267\350\256\277\351\227\256\440\550\564\564\560\472\457\457\552\541\566\541\456\563\565\556\456\543\557\555\457\552\541\566\541\563\545\457\544\557\567\556\554\557\541\544\563\n"
                    ;;
            "nlu.starting")
                    printf "\346\255\243\345\234\250\351\205\215\347\275\256\345\256\211\350\243\205\347\250\213\345\272\217\456\456\456\n"
                    ;;
            "nlu.arg.extract")
                    printf "\411$1\533\544\551\562\535\411\345\260\206\346\211\200\346\234\211\346\215\206\347\273\221\347\232\204\346\225\260\346\215\256\350\247\243\345\216\213\347\274\251\345\210\260\440\474\544\551\562\476\343\200\202\412\411\411\411\411\345\246\202\346\236\234\346\234\252\346\214\207\345\256\232\440\474\544\551\562\476\357\274\214\345\210\231\344\274\232\350\247\243\345\216\213\347\274\251\345\210\260\345\275\223\345\211\215\347\233\256\345\275\225\n"
                    ;;
            "nlu.arg.disable.space.check")
                    printf "\411$1\411\344\270\215\346\243\200\346\237\245\345\217\257\347\224\250\347\251\272\351\227\264\n"
                    ;;
            "nlu.integrity")
                    printf "\412\345\256\211\350\243\205\346\226\207\344\273\266\440$1\344\274\274\344\271\216\345\267\262\346\215\237\345\235\217\n"
                    ;;
            "nlu.running")
                    printf "\346\255\243\345\234\250\350\277\220\350\241\214\345\256\211\350\243\205\347\250\213\345\272\217\345\220\221\345\257\274\456\456\456\n"
                    ;;
            "nlu.arg.help")
                    printf "\411$1\411\346\230\276\347\244\272\346\255\244\345\270\256\345\212\251\n"
                    ;;
            "nlu.arg.javahome")
                    printf "\411$1\474\544\551\562\476\411\344\275\277\347\224\250\440\474\544\551\562\476\440\344\270\255\347\232\204\440\512\541\566\541\440\346\235\245\350\277\220\350\241\214\345\272\224\347\224\250\347\250\213\345\272\217\n"
                    ;;
            "nlu.extracting")
                    printf "\346\255\243\345\234\250\350\247\243\345\216\213\347\274\251\345\256\211\350\243\205\346\225\260\346\215\256\456\456\456\n"
                    ;;
            "nlu.arg.output")
                    printf "\411$1\474\557\565\564\476\411\345\260\206\346\211\200\346\234\211\350\276\223\345\207\272\351\207\215\345\256\232\345\220\221\345\210\260\346\226\207\344\273\266\440\474\557\565\564\476\n"
                    ;;
            "nlu.jvm.search")
                    printf "\346\255\243\345\234\250\346\220\234\347\264\242\347\263\273\347\273\237\344\270\212\347\232\204\440\512\526\515\456\456\456\n"
                    ;;
            *)
                    printf "$arg\n"
                    ;;
            esac
    }
    
    getLocalizedMessage_ja() {
            arg=$1
            shift
            case $arg in
            "nlu.freespace")
                    printf "\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\253\343\203\207\343\203\274\343\202\277\343\202\222\346\212\275\345\207\272\343\201\231\343\202\213\343\201\256\343\201\253\345\277\205\350\246\201\343\201\252\345\215\201\345\210\206\343\201\252\347\251\272\343\201\215\343\203\207\343\202\243\343\202\271\343\202\257\345\256\271\351\207\217\343\201\214\343\201\202\343\202\212\343\201\276\343\201\233\343\202\223\412\344\270\200\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200\343\201\253\440$1\515\502\440\343\201\256\347\251\272\343\201\215\343\203\207\343\202\243\343\202\271\343\202\257\345\256\271\351\207\217\343\201\214\345\277\205\350\246\201\343\201\247\343\201\231\343\200\202\412\343\203\207\343\202\243\343\202\271\343\202\257\345\256\271\351\207\217\343\202\222\343\202\257\343\203\252\343\203\274\343\203\263\343\202\242\343\203\203\343\203\227\343\201\227\343\200\201\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\343\202\222\343\202\202\343\201\206\344\270\200\345\272\246\345\256\237\350\241\214\343\201\227\343\201\246\343\201\217\343\201\240\343\201\225\343\201\204\343\200\202$2\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\345\274\225\346\225\260\343\202\222\344\275\277\347\224\250\343\201\231\343\202\213\343\201\250\343\200\201\345\215\201\345\210\206\343\201\252\343\203\207\343\202\243\343\202\271\343\202\257\345\256\271\351\207\217\343\201\214\343\201\202\343\202\213\344\270\200\346\231\202\343\203\225\343\202\251\343\203\253\343\203\200\343\202\222\346\214\207\345\256\232\343\201\247\343\201\215\343\201\276\343\201\231\343\200\202\n"
                    ;;
            "nlu.prepare.jvm")
                    printf "\343\203\220\343\203\263\343\203\211\343\203\253\347\211\210\440\512\526\515\440\343\202\222\346\272\226\345\202\231\344\270\255\456\456\456\n"
                    ;;
            "nlu.error.verify.bundled.jvm")
                    printf "\343\203\220\343\203\263\343\203\211\343\203\253\347\211\210\440\512\526\515\440\343\202\222\346\244\234\350\250\274\343\201\247\343\201\215\343\201\276\343\201\233\343\202\223\343\200\202\343\202\267\343\202\271\343\203\206\343\203\240\344\270\212\343\201\247\440\512\526\515\440\343\202\222\346\244\234\347\264\242\343\201\227\343\201\246\343\201\277\343\201\246\343\201\217\343\201\240\343\201\225\343\201\204\n"
                    ;;
            "nlu.cannot.unpack.jvm.file")
                    printf "\343\203\225\343\202\241\343\202\244\343\203\253\440$1\343\202\222\345\261\225\351\226\213\343\201\247\343\201\215\343\201\276\343\201\233\343\202\223\n"
                    ;;
            "nlu.arg.cpp")
                    printf "\411$1\474\543\560\476\411\474\543\560\476\440\343\202\222\344\275\277\347\224\250\343\201\227\343\201\246\343\202\257\343\203\251\343\202\271\343\203\221\343\202\271\343\202\222\345\205\210\351\240\255\343\201\253\344\273\230\345\212\240\n"
                    ;;
            "nlu.arg.tempdir")
                    printf "\411$1\474\544\551\562\476\411\474\544\551\562\476\440\343\202\222\344\275\277\347\224\250\343\201\227\343\201\246\344\270\200\346\231\202\343\203\207\343\203\274\343\202\277\343\202\222\346\212\275\345\207\272\440\n"
                    ;;
            "nlu.arg.locale")
                    printf "\411$1\474\554\557\543\541\554\545\476\411\346\214\207\345\256\232\343\201\227\343\201\237\440\474\554\557\543\541\554\545\476\440\343\202\222\344\275\277\347\224\250\343\201\227\343\201\246\343\203\207\343\203\225\343\202\251\343\203\253\343\203\210\343\203\255\343\202\261\343\203\274\343\203\253\343\202\222\343\202\252\343\203\274\343\203\220\343\203\274\343\203\251\343\202\244\343\203\211\n"
                    ;;
            "nlu.arg.cpa")
                    printf "\411$1\474\543\560\476\411\474\543\560\476\440\343\202\222\344\275\277\347\224\250\343\201\227\343\201\246\343\202\257\343\203\251\343\202\271\343\203\221\343\202\271\343\202\222\344\273\230\345\212\240\n"
                    ;;
            "nlu.cannot.extract.bundled.jvm")
                    printf "\343\203\220\343\203\263\343\203\211\343\203\253\347\211\210\440\512\526\515\440\343\202\222\346\212\275\345\207\272\343\201\247\343\201\215\343\201\276\343\201\233\343\202\223\n"
                    ;;
            "nlu.missing.external.resource")
                    printf "\516\545\564\502\545\541\556\563\440\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\343\202\222\345\256\237\350\241\214\343\201\247\343\201\215\343\201\276\343\201\233\343\202\223\343\200\202\412\345\277\205\351\240\210\343\203\207\343\203\274\343\202\277\343\202\222\345\220\253\343\202\200\345\244\226\351\203\250\343\203\225\343\202\241\343\202\244\343\203\253\343\201\214\345\277\205\350\246\201\343\201\247\343\201\231\343\201\214\350\246\213\343\201\244\343\201\213\343\202\212\343\201\276\343\201\233\343\202\223\472\412$1\n"
                    ;;
            "nlu.jvm.usererror")
                    printf "\346\214\207\345\256\232\343\201\227\343\201\237\345\240\264\346\211\200\440$1\343\201\253\440\512\541\566\541\440\522\565\556\564\551\555\545\440\505\556\566\551\562\557\556\555\545\556\564\440\450\512\522\505\451\440\343\201\214\350\246\213\343\201\244\343\201\213\343\202\212\343\201\276\343\201\233\343\202\223\343\201\247\343\201\227\343\201\237\n"
                    ;;
            "nlu.java.application.name.macosx")
                    printf "\516\545\564\502\545\541\556\563\440\511\504\505\440\343\201\256\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\n"
                    ;;
            "nlu.msg.usage")
                    printf "\412\344\275\277\347\224\250\346\226\271\346\263\225\472\n"
                    ;;
            "nlu.arg.silent")
                    printf "\411$1\411\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\343\202\222\343\202\265\343\202\244\343\203\254\343\203\263\343\203\210\343\201\253\345\256\237\350\241\214\n"
                    ;;
            "nlu.cannot.create.tmpdir")
                    printf "\344\270\200\346\231\202\343\203\207\343\202\243\343\203\254\343\202\257\343\203\210\343\203\252\440$1\343\202\222\344\275\234\346\210\220\343\201\247\343\201\215\343\201\276\343\201\233\343\202\223\n"
                    ;;
            "nlu.jvm.uncompatible")
                    printf "$1\343\201\256\440\512\526\515\440\343\203\220\343\203\274\343\202\270\343\203\247\343\203\263\343\201\257\343\202\265\343\203\235\343\203\274\343\203\210\343\201\225\343\202\214\343\201\246\343\201\204\343\201\276\343\201\233\343\202\223\343\200\202\412\343\203\221\343\203\251\343\203\241\343\203\274\343\202\277\440$2\343\202\222\344\275\277\347\224\250\343\201\227\343\201\246\345\210\245\343\201\256\440\512\526\515\440\343\201\256\345\240\264\346\211\200\343\202\222\346\214\207\345\256\232\343\201\227\343\201\246\343\201\217\343\201\240\343\201\225\343\201\204\n"
                    ;;
            "nlu.arg.verbose")
                    printf "\411$1\411\350\251\263\347\264\260\343\201\252\345\207\272\345\212\233\343\202\222\344\275\277\347\224\250\n"
                    ;;
            "nlu.jvm.notfoundmessage")
                    printf "\512\541\566\541\440\523\505\440\504\545\566\545\554\557\560\555\545\556\564\440\513\551\564\440\450\512\504\513\451\440\343\201\257\343\201\223\343\201\256\343\202\263\343\203\263\343\203\224\343\203\245\343\203\274\343\202\277\343\201\253\350\246\213\343\201\244\343\201\213\343\202\212\343\201\276\343\201\233\343\202\223\343\201\247\343\201\227\343\201\237\412\516\545\564\502\545\541\556\563\440\511\504\505\440\343\202\222\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\253\343\201\231\343\202\213\343\201\253\343\201\257\440\512\504\513\440\466\440\343\201\214\345\277\205\350\246\201\343\201\247\343\201\231\343\200\202\512\504\513\440\343\201\214\346\255\243\343\201\227\343\201\217\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\253\343\201\225\343\202\214\343\201\246\343\201\204\343\202\213\343\201\223\343\201\250\343\202\222\347\242\272\350\252\215\343\201\227\343\200\201\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\343\202\222\343\202\202\343\201\206\344\270\200\345\272\246\345\256\237\350\241\214\343\201\227\343\201\246\343\201\217\343\201\240\343\201\225\343\201\204\343\200\202\412$1\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\345\274\225\346\225\260\343\202\222\344\275\277\347\224\250\343\201\227\343\201\246\343\200\201\346\234\211\345\212\271\343\201\252\440\512\504\513\440\343\201\256\345\240\264\346\211\200\343\202\222\346\214\207\345\256\232\343\201\247\343\201\215\343\201\276\343\201\231\343\200\202\412\412\512\504\513\440\343\202\222\343\203\200\343\202\246\343\203\263\343\203\255\343\203\274\343\203\211\343\201\231\343\202\213\343\201\253\343\201\257\343\200\201\550\564\564\560\472\457\457\552\541\566\541\456\563\565\556\456\543\557\555\457\552\541\566\541\563\545\457\544\557\567\556\554\557\541\544\563\440\343\201\253\343\202\242\343\202\257\343\202\273\343\202\271\343\201\227\343\201\246\343\201\217\343\201\240\343\201\225\343\201\204\n"
                    ;;
            "nlu.starting")
                    printf "\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\343\202\222\346\247\213\346\210\220\343\201\227\343\201\246\343\201\204\343\201\276\343\201\231\456\456\456\n"
                    ;;
            "nlu.arg.extract")
                    printf "\411$1\533\544\551\562\535\411\343\201\231\343\201\271\343\201\246\343\201\256\343\203\220\343\203\263\343\203\211\343\203\253\343\203\207\343\203\274\343\202\277\343\202\222\440\474\544\551\562\476\440\343\201\253\346\212\275\345\207\272\343\200\202\412\412\411\411\411\411\474\544\551\562\476\440\343\201\214\346\214\207\345\256\232\343\201\225\343\202\214\343\201\246\343\201\204\343\201\252\343\201\204\345\240\264\345\220\210\343\201\257\347\217\276\345\234\250\343\201\256\343\203\207\343\202\243\343\203\254\343\202\257\343\203\210\343\203\252\343\201\253\346\212\275\345\207\272\440\n"
                    ;;
            "nlu.arg.disable.space.check")
                    printf "\411$1\411\347\251\272\343\201\215\345\256\271\351\207\217\343\201\256\343\203\201\343\202\247\343\203\203\343\202\257\343\202\222\347\204\241\345\212\271\345\214\226\n"
                    ;;
            "nlu.integrity")
                    printf "\412\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\343\203\225\343\202\241\343\202\244\343\203\253\440$1\343\201\214\345\243\212\343\202\214\343\201\246\343\201\204\343\202\213\345\217\257\350\203\275\346\200\247\343\201\214\343\201\202\343\202\212\343\201\276\343\201\231\n"
                    ;;
            "nlu.running")
                    printf "\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\251\343\202\246\343\202\243\343\202\266\343\203\274\343\203\211\343\202\222\345\256\237\350\241\214\344\270\255\456\456\456\n"
                    ;;
            "nlu.arg.help")
                    printf "\411$1\411\343\201\223\343\201\256\343\203\230\343\203\253\343\203\227\343\202\222\350\241\250\347\244\272\n"
                    ;;
            "nlu.arg.javahome")
                    printf "\411$1\474\544\551\562\476\411\343\202\242\343\203\227\343\203\252\343\202\261\343\203\274\343\202\267\343\203\247\343\203\263\343\202\222\345\256\237\350\241\214\343\201\231\343\202\213\343\201\237\343\202\201\343\201\253\440\474\544\551\562\476\440\343\201\256\440\552\541\566\541\440\343\202\222\344\275\277\347\224\250\440\n"
                    ;;
            "nlu.extracting")
                    printf "\343\202\244\343\203\263\343\202\271\343\203\210\343\203\274\343\203\253\343\203\207\343\203\274\343\202\277\343\202\222\346\212\275\345\207\272\343\201\227\343\201\246\343\201\204\343\201\276\343\201\231\456\456\456\n"
                    ;;
            "nlu.arg.output")
                    printf "\411$1\474\557\565\564\476\411\343\201\231\343\201\271\343\201\246\343\201\256\345\207\272\345\212\233\343\202\222\343\203\225\343\202\241\343\202\244\343\203\253\440\474\557\565\564\476\440\343\201\253\343\203\252\343\203\200\343\202\244\343\203\254\343\202\257\343\203\210\n"
                    ;;
            "nlu.jvm.search")
                    printf "\343\202\267\343\202\271\343\203\206\343\203\240\343\201\247\440\512\526\515\440\343\202\222\346\244\234\347\264\242\343\201\227\343\201\246\343\201\204\343\201\276\343\201\231\456\456\456\n"
                    ;;
            *)
                    printf "$arg\n"
                    ;;
            esac
    }
    
    
    TEST_JVM_FILE_TYPE=0
    TEST_JVM_FILE_SIZE=658
    TEST_JVM_FILE_MD5="661a3c008fab626001e903f46021aeac"
    TEST_JVM_FILE_PATH="\$L{nbi.launcher.tmp.dir}/TestJDK.class"
    
    JARS_NUMBER=1
    JAR_0_TYPE=0
    JAR_0_SIZE=36608505
    JAR_0_MD5="cde67ed0d6fb0176579d1f9128db55e0"
    JAR_0_PATH="\$L{nbi.launcher.tmp.dir}/bundle.jar"
    
    
    JAVA_COMPATIBLE_PROPERTIES_NUMBER=1
    
    setJavaCompatibilityProperties_0() {
    JAVA_COMP_VERSION_MIN="1.6.0"
    JAVA_COMP_VERSION_MAX=""
    JAVA_COMP_VENDOR=""
    JAVA_COMP_OSNAME=""
    JAVA_COMP_OSARCH=""
    }
    OTHER_RESOURCES_NUMBER=0
    TOTAL_BUNDLED_FILES_SIZE=36609163
    TOTAL_BUNDLED_FILES_NUMBER=2
    MAIN_CLASS="org.netbeans.installer.Installer"
    TEST_JVM_CLASS="TestJDK"
    JVM_ARGUMENTS_NUMBER=2
    JVM_ARGUMENT_0="-Xmx256m"
    JVM_ARGUMENT_1="-Xms64m"
    APP_ARGUMENTS_NUMBER=0
    LAUNCHER_STUB_SIZE=87              
    entryPoint "$@"
    
     
Статус темы:
Закрыта.