Created
March 13, 2017 12:44
-
-
Save takehiko/a963251e2284072b243604883287ceb2 to your computer and use it in GitHub Desktop.
Java configuration for Cygwin + zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -f $HOME/.java_home ] | |
then | |
export JAVA_HOME=$(cat $HOME/.java_home) | |
elif (\ls -1 $C/Program\ Files/Java | grep -q jdk) | |
then | |
export JAVA_HOME="$C/Program Files/Java/$(\ls -1 $C/Program\ Files/Java | grep jdk | tail -n 1)" | |
echo $JAVA_HOME > $HOME/.java_home | |
fi | |
if [ ${+JAVA_HOME} = 1 ] && [ -d $JAVA_HOME ] | |
then | |
if [ ! -f $HOME/bin/java_wrapper ] | |
then | |
PATH=$JAVA_HOME/bin:$PATH | |
fi | |
else | |
unset $JAVA_HOME | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment