在ubuntu下 使用Jetty 和 Maven 开发 HelloWorld
- 1 安装JDK
我以前安装过,这里就不说了。
- 2 安装maven
解压
添加环境变量 gedit ~/.bashrc
export JETTY_HOME=/home/roc/libs/jetty-7
export M2_HOME=/home/roc/libs/apache-maven-3.2.3
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=${M2_HOME}/bin:$PATH
export M2_HOME=/home/roc/libs/apache-maven-3.2.3
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=${M2_HOME}/bin:$PATH
执行 source ~/.bashrc 生效
不行的话 注销一下
测试 maven -version
:~$ mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:10+08:00)
Maven home: /home/roc/libs/apache-maven-3.2.3
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: /usr/lib/myjvm/jdk7/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-39-generic", arch: "amd64", family: "unix"
Maven home: /home/roc/libs/apache-maven-3.2.3
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: /usr/lib/myjvm/jdk7/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-39-generic", arch: "amd64", family: "unix"
- 开始了