1. Download JDK1.6
http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html
2. Put jdk file to /opt/Java folder
execute ./jdkfilename.bin to install
3. Config Java Environment:
vim(gedit) ~/.bashrc
添加:
export JAVA_HOME=/opt/Java/jdk1.6.0_31
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
Execute Source ~/.bashrc to apply envrionment right now.
4. Execute java -version to verify if it is OK.
5. Download Maven bin file
http://www.fayea.com/apache-mirror/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
6. Put the download file to /usr/local/maven
CMD: sudo cp filename to /usr/local/maven
7. Add rights for maven folder:
CMD: sudo chmod a+x+w maven
8. Decompress the tar file :
CMD: tar -zxvf apache-maven-3.0.4-bin.tar.gz
9. Add maven environment variables:
9.1 vi(gedit) /etc/profile
9.2 MAVEN_HOME=/usr/local/apache-maven-3.0.3
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
9.3. Source /etc/profile ( apply now )
10. check if maven is ok:
mvn -version
Congratulations!