# ---------------------------------------------------------------------
export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=“fcitx”
export QT_IM_MODULE=“fcitx”
message()
{
TITLE=“Cannot start Android Studio”
if [ -n “`which zenity`” ]; then
zenity --error --title="$TITLE" --text="$1"
elif [ -n “`which kdialog`” ]; then
kdialog --error “ 1 " − − t i t l e " 1" --title " 1"−−title"TITLE”
elif [ -n “`which xmessage`” ]; then
xmessage -center “ERROR: $TITLE: $1”
elif [ -n “`which notify-send`” ]; then
notify-send “ERROR: $TITLE: $1”
else
echo “ERROR: $TITLE\n$1”
fi
}
isJDK()
{
if [ -z $1 ] || [ ! -x “$1/bin/java” ]; then
return 1
else
return 0
fi
}
UNAME=`which uname`
GREP=`which egrep`
GREP_OPTIONS=""
CUT=`which cut`
READLINK=`which readlink`
XARGS=`which xargs`
DIRNAME=`which dirname`
MKTEMP=`which mktemp`
RM=`which rm`
CAT=`which cat`
TR=`which tr`
if [ -z “ U N A M E " − o − z " UNAME" -o -z " UNAME"−o−z"GREP” -o -z “ C U T " − o − z " CUT" -o -z " CUT"−o−z"MKTEMP” -o -z “ R M " − o − z " RM" -o -z " RM"−o−z"CAT” -o -z “$TR” ]; then
message “Required tools are missing - check beginning of \”$0\" file for details."
exit 1
fi
OS_TYPE=`"$UNAME" -s`
# ---------------------------------------------------------------------
# Ensure IDE_HOME points to the directory where the IDE is installed.
# ---------------------------------------------------------------------
SCRIPT_LOCATION=$0
if [ -x “$READLINK” ]; then
while [ -L “$SCRIPT_LOCATION” ]; do
SCRIPT_LOCATION=`“ R E A D L I N K " − e " READLINK" -e " READLINK"−e"SCRIPT_LOCATION”`
done
fi
IDE_BIN_HOME=`dirname “$SCRIPT_LOCATION”`
if [ “$IDE_BIN_HOME” = “.” ]; then
IDE_HOME="…"
else
IDE_HOME=`dirname “$IDE_BIN_HOME”`
fi
# ---------------------------------------------------------------------
# Locate a JDK installation directory which will be used to run the IDE.
# Try (in order): STUDIO_JDK, studio.jdk, …/jre, JDK_HOME, JAVA_HOME, “java” in PATH.
# ---------------------------------------------------------------------
JDK=""
if isJDK $STUDIO_JDK; then
JDK="$STUDIO_JDK"
fi
if [ “KaTeX parse error: Can't use function '\]' in math mode at position 11: JDK" = "" \̲]̲ && \[ -s "HOME/.AndroidStudio3.0/config/studio.jdk” ]; then
JDK=`"$CAT" $HOME/.AndroidStudio3.0/config/studio.jdk`
if [ ! -d “$JDK” ]; then
JDK=“ I D E _ H O M E / IDE\_HOME/ IDE_HOME/JDK”
fi
if ! isJDK $JDK; then
JDK=""
fi
fi
if [ “KaTeX parse error: Can't use function '\]' in math mode at position 11: JDK" = "" \̲]̲ && \[ "OS_TYPE” = “Linux” ] &&
[ -x “KaTeX parse error: Can't use function '\]' in math mode at position 25: …/jre/bin/java" \̲]̲ && "IDE_HOME/jre/bin/java” -version > /dev/null 2>&1 ; then
JDK="$IDE_HOME/jre"
fi
if [ “$JDK” = “” ] && isJDK $JDK_HOME; then
JDK="$JDK_HOME"
fi
if [ “$JDK” = “” ]; then
if isJDK $JAVA_HOME; then
JDK="$JAVA_HOME"
else
JAVA_BIN_PATH=`which java`
if [ -n “$JAVA_BIN_PATH” ]; then
if [ “ O S _ T Y P E " = " F r e e B S D " − o " OS\_TYPE" = "FreeBSD" -o " OS_TYPE"="FreeBSD"−o"OS_TYPE” = “MidnightBSD” ]; then
JAVA_LOCATION=`JAVAVM_DRYRUN=yes java | “ G R E P " ′ J A V A _ H O M E ′ ∣ " GREP" '^JAVA\_HOME' | " GREP"′JAVA_HOME′∣"CUT” -c11-`
if [ -x “$JAVA_LOCATION/bin/java” ]; then
JDK="$JAVA_LOCATION"
fi
elif [ “$OS_TYPE” = “SunOS” ]; then
JAVA_LOCATION="/usr/jdk/latest"
if [ -x “$JAVA_LOCATION/bin/java” ]; then
JDK="$JAVA_LOCATION"
fi
elif [ “$OS_TYPE” = “Darwin” ]; then
JAVA_LOCATION=`/usr/libexec/java_home`
if [ -x “$JAVA_LOCATION/bin/java” ]; then
JDK="$JAVA_LOCATION"
fi
fi
fi
if [ -z “ J D K " − a − x " JDK" -a -x " JDK"−a−x"READLINK” -a -x “ X A R G S " − a − x " XARGS" -a -x " XARGS"−a−x"DIRNAME” ]; then
JAVA_LOCATION=`“ R E A D L I N K " − f " READLINK" -f " READLINK"−f"JAVA_BIN_PATH”`
case “$JAVA_LOCATION” in
*/jre/bin/java)
JAVA_LOCATION=`echo “ J A V A _ L O C A T I O N " ∣ " JAVA\_LOCATION" | " JAVA_LOCATION"∣"XARGS” “ D I R N A M E " ∣ " DIRNAME" | " DIRNAME"∣"XARGS” “ D I R N A M E " ∣ " DIRNAME" | " DIRNAME"∣"XARGS” “$DIRNAME”`
if [ ! -d “$JAVA_LOCATION/bin” ]; then
JAVA_LOCATION="$JAVA_LOCATION/jre"
fi
;;
*)
JAVA_LOCATION=`echo “ J A V A _ L O C A T I O N " ∣ " JAVA\_LOCATION" | " JAVA_LOCATION"∣"XARGS” “ D I R N A M E " ∣ " DIRNAME" | " DIRNAME"∣"XARGS” “$DIRNAME”`
;;
esac
if [ -x “$JAVA_LOCATION/bin/java” ]; then
JDK="$JAVA_LOCATION"
fi
fi
fi
fi
JAVA_BIN="$JDK/bin/java"
if \
《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整内容开源分享
[ ! -x “$JAVA_BIN” ]; then
JAVA_BIN="$JDK/jre/bin/java"
fi
if [ -z “KaTeX parse error: Can't use function '\]' in math mode at position 6: JDK" \̲]̲ || \[ ! -x "JAVA_BIN” ]; then
message “No JDK found. Please validate either STUDIO_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.”
exit 1
fi
VERSION_LOG=`"$MKTEMP" -t java.version.log.XXXXXX`
JAVA_TOOL_OPTIONS= “ J A V A _ B I N " − v e r s i o n 2 > " JAVA\_BIN" -version 2> " JAVA_BIN"−version2>"VERSION_LOG”
“ G R E P " " 64 − B i t ∣ x 86 _ 64 ∣ a m d 64 " " GREP" "64-Bit|x86\_64|amd64" " GREP""64−Bit∣x86_64∣amd64""VERSION_LOG” > /dev/null
BITS=$?
“ R M " − f " RM" -f " RM"−f"VERSION_LOG”
test ${BITS} -eq 0 && BITS=“64” || BITS=""
# ---------------------------------------------------------------------
# Collect JVM options and IDE properties.
# ---------------------------------------------------------------------
if [ -n “$STUDIO_PROPERTIES” ]; then
IDE_PROPERTIES_PROPERTY="-Didea.properties.file=$STUDIO_PROPERTIES"
fi
VM_OPTIONS=""
VM_OPTIONS_FILES_USED=""
for vm_opts_file in “ I D E _ B I N _ H O M E / s t u d i o IDE\_BIN\_HOME/studio IDE_BIN_HOME/studioBITS.vmoptions” “ O S _ S P E C I F I C _ B I N _ D I R / s t u d i o OS\_SPECIFIC\_BIN\_DIR/studio OS_SPECIFIC_BIN_DIR/studioBITS.vmoptions” “ H O M E / . A n d r o i d S t u d i o 3.0 / s t u d i o HOME/.AndroidStudio3.0/studio HOME/.AndroidStudio3.0/studioBITS.vmoptions” “$STUDIO_VM_OPTIONS”; do
if [ -r “$vm_opts_file” ]; then
VM_OPTIONS_DATA=`“ C A T " " CAT" " CAT""vm_opts_file” | “KaTeX parse error: Expected group after '^' at position 11: GREP" -v "^̲#.\*" | "TR” ‘\n’ ’ '`
VM_OPTIONS="$VM_OPTIONS $VM_OPTIONS_DATA"
if [ -n “$VM_OPTIONS_FILES_USED” ]; then