⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 locate-jre

📁 无线通信的主要编程软件,是无线通信工作人员的必备工具,关天相关教程我会在后续传上.
💻
字号:
#!/bin/sh# This script attempts to locate the jre directory of the current# Java installation, even when java is not in the path# We only support it for Sun's Java on Windows and IBM's Java on Linux# We require an option to specify which directory is desired:# --java: directory with java executable# --javac: directory with javac executable# --jni: directory where JNI code is placedif [ "$1" = "--jni" ]; then  jni=yeselif [ "$1" = "--java" ]; then  java=yeselif [ "$1" = "--javac" ]; then  javac=yeselse  echo "Usage: locate-jre --java|--javac|--jni" >&2  exit 2ficase `uname` in  CYGWIN*)        # Hopefully this will always work on cygwin with Sun's Java	jversion=`regtool -q get '\HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion'`	if [ $? != 0 ]; then	    exit 1	fi	jhome=`regtool -q get '\HKLM\SOFTWARE\JavaSoft\Java Development Kit\'$jversion'\JavaHome'`	if [ $? != 0 ]; then	    exit 1	fi	jhome=`cygpath -u "$jhome"`	;;    Linux)        # On Linux, we first try to find it from the rpm	j=`rpm -ql IBMJava2-SDK | grep -m 1 'bin/javac$'`	if [ $? != 0 ]; then            # Next we try the path. This won't work within rpms, as they reset            # the path (and we can't just execute the profile as that tends to             # execute locate-jre ...). Life is hard...	    j=`which javac 2>/dev/null`	    if [ $? != 0 ]; then		exit 1	    fi	fi	jbin=`dirname "$j"`	jhome=`dirname "$jbin"`	;;    FreeBSD)	if [ -f /usr/local/jdk1.4*/bin/java ]; then	    jbin=/usr/local/jdk1.4*/bin	else	    exit 1	fi	jhome=`dirname $jbin`	;;esac# These are correct for Sun's Window java and IBM's Linux javaif [ "$jni" = "yes" ]; then  case `uname` in    FreeBSD)        UNAMEM=`uname -m`	dir="$jhome/jre/lib/$UNAMEM"	;;    *)	dir="$jhome/jre/bin"	;;  esacelif [ "$javac" = "yes" ]; then  dir="$jhome/bin"elif [ "$java" = "yes" ]; then  dir="$jhome/jre/bin"fi# Check that what we found actually existsif [ -d "$dir" ]; then  echo $direlse  exit 1fi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -