1、序言html
这里记录了安装ubuntu 系统,以及里面经常使用的东西,jdk,idea,maven,svn,git 等等工具的安装,由于这些动做不是常常操做的,所以这里作一个记录,方便新手或者忘记的时候看看。java
2、JDK 安装linux
1.关于ubuntu 的安装,我这里不介绍了,用的是U盘启动的方式,版本是14.1,直接从官方网站下下来,我8G内存,用的64位的系统,固然一些基本的命令这里不介绍了。git
2.JDK 的安装,我用的JDK8,先去官网下载为1.8.xxx.tar.gz,我放到本身创建的program 文件下github
用tar -zxvf 解压,获得 jdk1.8.0_40 文件。web
官网地址:http://www.oracle.com/technetwork/java/javase/downloads/index.htmlapache
3.设置JAVA_HOME 环境,这里有两种方式,一种直接设置到系统里面,一种是和当前登陆用户相关,我这里用的第二种,用 控制台:sudo gedit /etc/prifile ,输入你的帐户密码,在弹出的 文件末未加上ubuntu
#set java environment,环境路径记得改为本身的目录 export JAVA_HOME=/home/xx/program/jdk1.8.0_40 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
固然,还得设置使用的东西,这里后面为多个JDK 设置方便,这里只有一个~.~,控制台输入tomcat
# 这3行代码 分开输入 sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_40/bin/javac 300 sudo update-alternatives --config JAVA sudo update-alternatives --config javac
而后你执行javer -version 就,输出正常就OK了oracle
3、安装IDE 工具idea,这个工具 感受比eclipse 用着舒服,我版本是idea 14的
下载地址:http://www.jetbrains.com/idea/
1.解压文件 tar -zvxf ideaIU-14.0.3.tar.gz /xx/program 解压位置本身选吧。
2.进到刚才的安装目录下:cd idea-IU-139.1117.1/bin ,而后执行 ./idea.sh 就好了
顺便说一下,idea 14 是须要收费的,虽然我不支持盗版,可是你懂的..找个KEY 生成器,附件上我会上传,拿去用就好了。
4、MAVEN 安装
如今不少工程都是MAVEN 相关了,包括idea 里面的集成东西,所以最好把这个安装了才使用IDE吧。
下载地址:http://maven.apache.org/download.cgi
1.解压:tar -zvxf apache-maven-3.2.5-bin.tar.gz ,位置本身选
2.一样设置环境变量:sudo gedit /etc/profile 打开以后末未添加
#set maven environment M2_HOME=/home/xx/program/apache-maven-3.2.5 export MAVEN_OPTS="-Xms256m -Xmx512m" export PATH=$M2_HOME/bin:$PATH
3.要让这个生效,可使用上面JDK 那种命令,固然还有另一种: . /etc/profile
4.若是控制台输入:mvn -version 获得正常版本信息,就成功了
另外,若是google出不去的,须要改下host 文件,配置一些外网的IP,本身搜索hosts google 2015 就能找到,或者用个人红杏推荐,能够免费10天:http://honx.in/VMWWmM6vD3FssczA
4、SVN 安装
这里直接用命令:sudo apt-get install subversion
基本上安装完了, 就能够用 idea checkout 项目了,使用的时候记得 用本身定的MAVAN 目录。
5、git github 安装
地址介绍:http://rogerdudler.github.io/git-guide/index.zh.html
酷推:http://www.tuicool.com/articles/MJvuua
1.先下个git 吧,命令:
sudo apt-get install git-core
2.设定你的github 名字和邮箱
git config --global user.name = "用户名或者用户ID" git config --global user.email = "邮箱"
3.建立你的 公钥
ssh-keygen -C 'emailaddress@gmail.com' -t rsa
4.测试是否连通
ssh -v git@github.com
5.把你公钥添加到 github的SSH key里面,打开公钥,复制一下就好了
cat ~/.ssh/github.pub
6.在你的idea 里面 file->setting-<github 里面填写
host:github.com login:你的邮箱 password:密码
7. checkout 或者 import 项目到github
从idead->vcs->checkout 或者import->share ..github 或者先建立本地的import->created git repository
这就基本安装OK了,就能够自由的 pull push 了。
固然你能够连接到这里开源:http://git.oschina.net/
配置地址:http://my.oschina.net/lujianing/blog/194069
6、jetty 和 tomcat 的插件安装,这里我是用的maven 插件,直接贴配置吧
<!--具体参数本身要设置一下 -->
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <path>/agent</path> <uriEncoding>utf-8</uriEncoding> <port>${app.port}</port> <server>tomcat</server> <warFile>${app.warFile}.war</warFile> <systemProperties> <systemProperty> <name>JAVA_OPTS</name> <value>-Xms256m -Xmx768m -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m -XX:NewRatio=6 -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled </value> </systemProperty> </systemProperties> </configuration> </plugin>
<!-- --> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.8.v20121106</version> <configuration> <stopKey>stop</stopKey> <stopPort>5599</stopPort> <reload>manual</reload> <webAppConfig> <contextPath>/</contextPath> </webAppConfig> <scanIntervalSeconds>5</scanIntervalSeconds> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>80</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> </configuration> <dependencies> <dependency> <groupId>net.alchim31</groupId> <artifactId>livereload-jvm</artifactId> <version>0.2.0</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <configuration> <skipTests>${skipTests}</skipTests> </configuration> </plugin>
更多的能够参考:
http://www.infoq.com/cn/news/2011/04/xxb-maven-7-plugin/
http://maven.apache.org/plugins/index.html