Last active
August 29, 2015 14:03
-
-
Save tartalia/7cdc21cc59cd868de761 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
# Configure JAVA_HOMEnn | |
set java_home | |
java_home=`sudo cat /etc/environment | grep JAVA_HOME` | |
if [ -z $java_home ]; then | |
sudo sh -c 'echo JAVA_HOME=/opt/jdk1.7.0_55 >> /etc/environment' | |
fi | |
# Add JAVA_HOME to PATH | |
export JAVA_HOME=/opt/jdk1.7.0_55 | |
java_home=`cat ~/.bashrc | grep $JAVA_HOME` | |
if [ -z $java_home ]; then | |
echo "configuring java..." | |
echo "PATH=$JAVA_HOME/bin:$PATH" >> ~/.bashrc | |
cd /opt | |
curl -L https://www.dropbox.com/sh/icoaf3qa2tygrfx/AAAsrxgKA1ZBbU-KQt1R2r19a/jdk-7u55-linux-x64.tar.gz | sudo tar zxv | |
cd - | |
echo "done." | |
else | |
echo "java already installed." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment