CentOs7安装JDK/Tomcat/Git/Gradle
安装Jdk:
wget http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
rpm -ivh jdk-8u65-linux-x64.rpm
修改/etc/profile增加:
export JAVA_HOME=/usr/java/jdk1.8.0_131
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/toolds.jar:$JRE_HOME/lib
安装Tomcat:
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.77/bin/apache-tomcat-7.0.77.tar.gz
tar -axv -f apache-tomcat-7.0.77.tar.gz
配置访问tomcat管理系统权限,修改 /usr/local/tomcat/conf/tomcat-usrs.xml 增加:
<user username="admin" password="xxxxx" roles="admin-gui,manager-gui,manager-script,manager-status,manager-jmx"/>
安装Git:
安装git:yum install git
查看git版本:git --version
删除git:yum remove git
无需密码登录设置:
正常设置:git config credential.helper store 然后再执行git pull 或其他需要输入账号的命令,最终账号信息会保存在.gitconfig配置中
额外补充:
错误提示:git: 'credential-wincred' is not a git command. 解决:git config --unset --global credential.helper
查看ssh登录日志:tail /var/log/secure -n 20
显示隐藏文件.git:ls -a
检查git设置: git config --list
安装Gradle:
wget https://downloads.gradle.org/distributions/gradle-2.8-all.zip
unzip gradle-2.8-all.zip
mv gradle-2.8 /usr/local/gradle
修改/etc/profile增加以下两句:
export GRADLE_HOME=/usr/local/gradle
export PATH=$PATH:$GRADLE_HOME/bin
查看gradle版本:gradle -v
指定web工作应用程序路径,修改gradle war插件:
war {
webAppDirName="src/main/webroot"
}
gradle war插件说明:https://docs.gradle.org/current/userguide/war_plugin.html