-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_java_mvn.sh
executable file
·26 lines (17 loc) · 1008 Bytes
/
install_java_mvn.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
##java
sudo yum install java-1.8.0-openjdk-devel -y
#echo "export JAVA_HOME=\$(dirname \$(dirname \$(readlink -f \$(which java))))" | sudo tee --append /etc/profile
#echo "export PATH=\$JAVA_HOME/bin:\$PATH" | sudo tee --append /etc/profile
#export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
#export PATH=$JAVA_HOME/bin:$PATH
echo "export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.35.amzn1.x86_64" | sudo tee --append /etc/profile
echo "export PATH=\$JAVA_HOME/bin:\$PATH" | sudo tee --append /etc/profile
##run these lines outside the script, or run "source <this script>"
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.35.amzn1.x86_64
export PATH=$JAVA_HOME/bin:$PATH
##maven
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version