安装JDK7
http://www.oracle.com/technetwork/java/javase/downloads/index.html
sudo groupadd java
sudo useradd -r -g java java
sudo passwd java
sudo tar zxvf ~/Downloads/jdk-7u21-linux-x64.tar.gz -C /opt
sudo ln -s /opt/jdk1.7.0_21 /opt/jdk7
sudo chown -R java:java /opt/jdk7
sudo gedit /etc/profile
export JAVA_HOME="/opt/jdk7"
export JRE_HOME="/opt/jdk7/jre"
export CLASSPATH=".:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH"
export PATH="$JAVA_HOME/bin:$PATH"
source /etc/profile
sudo update-alternatives --install /usr/bin/java java /opt/jdk7/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk7/bin/javac 300
sudo update-alternatives --install /usr/bin/javaws javaws /opt/jdk7/bin/javaws 300
sudo update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk7/bin/javadoc 300
sudo update-alternatives --install /usr/bin/jar jar /opt/jdk7/bin/jar 300
sudo update-alternatives --install /usr/bin/javah javah /opt/jdk7/bin/javah 300
sudo update-alternatives --install /usr/bin/javap javap /opt/jdk7/bin/javap 300
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
sudo update-alternatives --config javadoc
sudo update-alternatives --config jar
sudo update-alternatives --config javah
sudo update-alternatives --config javap
java -version
如果提示java versioin "1.7.0_09"表示安装成功
安装tomcat7
http://tomcat.apache.org/download-70.cgi
sudo tar zxvf ~/Downloads/apache-tomcat-7.0.39.tar.gz -C /opt
sudo ln -s /opt/apache-tomcat-7.0.39 /opt/tomcat7
sudo chown -R java:java /opt/tomcat7
cd /opt/tomcat7/bin
sudo gedit catalina.sh
JAVA_HOME="/opt/jdk7"
JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:PermSize=600M -XX:MaxPermSize=600m -Dcom.sun.management.jmxremote"
sudo /opt/tomcat7/bin/startup.sh
# 停止服务:终端执行
# sudo /opt/tomcat7/bin/shutdown.sh
安装maven3
http://maven.apache.org/download.html
sudo tar zxvf ~/Downloads/apache-maven-3.3.3-bin.tar.gz -C /opt
sudo ln -s /opt/apache-maven-3.3.3 /opt/maven
sudo chown -R java:java /opt/maven
sudo gedit /etc/profile
export MVN_HOME="/opt/maven"
export PATH="$MVN_HOME/bin:$PATH"
source /etc/profile
mvn -version
如果提示Apache Maven 3.3.3表示安装成功
以下是maven日常操作:
%MVN_HOME%/conf/settings.xml
<localRepository>/path/to/local/repo</localRepository>
安装nexus
http://www.sonatype.org/nexus/go
sudo tar zxvf ~/Downloads/nexus-2.11.1-01-bundle.tar.gz -C /opt
sudo ln -s /opt/nexus-2.11.1-01 /opt/nexus
sudo chown -R java:java /opt/nexus
sudo chown -R java:java /opt/sonatype-work
sudo cp /opt/nexus/bin/nexus /etc/init.d/nexus
sudo gedit /etc/init.d/nexus
# 修改以下变量
NEXUS_HOME="/opt/nexus"
RUN_AS_USER=root
PIDDIR=$NEXUS_HOME
sudo update-rc.d nexus defaults
# 取消开机启动
# sudo update-rc.d -f nexus remove
以下是nexus日常操作:
sudo service nexus start 或者 sudo /etc/init.d/nexus start
sudo service nexus stop 或者 sudo /etc/init.d/nexus stop
sudo tail -f /opt/nexus/logs/wrapper.log
http://localhost:8081/nexus
admin/admin123
%Nexus_HOME%/conf/nexus.properties
nexus-work=${bundleBasedir}/../../sonatype-work/nexus
点击菜单Repositories -> Add -> Proxy Repository
输入以下内容
Repository ID : spring-snapshots
Repository Name : Spring Snapshots
Remote Storage Location :http://repo.spring.io/libs-snapshot
点击save
选中Repositories -> Public Repositories -> Configuration
将Spring Snapshots从右侧 Available Repositories 移到左侧 Ordered Group Repositories
点击save