centos 7安装jdk1.7等常用开发工具

发布时间:2020-06-02 发布网站:脚本之家
脚本之家收集整理的这篇文章主要介绍了centos 7安装jdk1.7等常用开发工具脚本之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
1 安装jdk: xshell执行命令:java -version,显示: java version "1.7.0_51" OpenJDK Runtime Environment (rhel-2.4.5.5.el7-x86_64 u51-b31) OpenJDK 64-Bit Server VM (build 24.51-b03,mixed mode) 表示centos已安装openjdk 1.7; 2 安装tomcat: [root@localhost admin]# wget http://mirrors.cnnic.cn/apache/tomcat/tomcat-7/v7.0.67/bin/apache-tomcat-7.0.67.tar.gz [root@localhost admin]# mv apache-tomcat-7.0.67 /usr/share/tomcat7 [root@localhost admin]# su admin [admin@localhost ~]$ cd /usr/share/tomcat7 && bin/startup.sh & [admin@localhost ~]$ cd /etc [admin@localhost etc]$ cd sysconfig [admin@localhost sysconfig]$ vim iptables [admin@localhost sysconfig]$ su Password: [root@localhost sysconfig]# vim iptables [root@localhost etc]# systemctl status iptables.service [root@localhost etc]# su admin [admin@localhost etc]$ su Password: [root@localhost etc]# systemctl status firewalld.service [root@localhost etc]# systemctl restart firewalld.service [root@localhost etc]# vim /etc/sysconfig/iptables [root@localhost etc]# systemctl restart firewalld.service [root@localhost etc]# service iptables stop Redirecting to /bin/systemctl stop iptables.service [root@localhost etc]# systemctl stop firewalld.service [root@localhost etc]# systemctl status firewalld.service [root@localhost etc]# su admin [admin@localhost etc]$ netstat -an | grep 8080 tcp6 0 0 :::8080 :::* LISTEN [admin@localhost etc]$ su Password: [root@localhost etc]# systemctl start firewalld.service [root@localhost etc]# systemctl status firewalld.service [root@localhost etc]# systemctl stop firewalld.service 关闭虚拟机中centos防火墙后,主机访问http://192.168.137.0:8080/,检测是否正常配置。 3 安装git centos7的yum仓库中已经自带了git,你可以使用如下命令安装: yum install git 9 centos 安装jdk 1.7 http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz?AuthParam=1453898216_38e5b1ec2b0456427cb3ae177181a989 [root@localhost Downloads]# tar -zxvf jdk-7u79-linux-x64.gz [root@localhost Downloads]# ls apache-maven-3.3.9-bin.tar.gz hello jdk1.7.0_79 jdk-7u79-linux-x64.gz phddns-2.0.6.el6.x86_64.rpm [root@localhost Downloads]# mkdir /usr/local/java [root@localhost Downloads]# mv jdk1.7.0_79 /usr/local/java [root@localhost java]# java -version java version "1.7.0_51" OpenJDK Runtime Environment (rhel-2.4.5.5.el7-x86_64 u51-b31) OpenJDK 64-Bit Server VM (build 24.51-b03,mixed mode) [root@localhost java]# rpm -qa | grep java [root@localhost java]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.51-2.4.5.5.el7.x86_64 [root@localhost java]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.51-2.4.5.5.el7.x86_64 [root@localhost java]# java -version bash: /usr/bin/java: No such file or directory [root@localhost java]# vim /etc/profile 打开之后在末尾添加 export JAVA_HOME=/usr/local/java/jdk1.7.0_79 export JRE_HOME=/usr/local/java/jdk1.7.0_79/jre export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin: $PATH 注:文件末尾不能有空行 [root@localhost java]# source /etc/profile [root@localhost java]# java -version java version "1.7.0_79" 重新登录账户,再次运行java-version,验证jdk是否安装成功。redhat上安装jdk与centos上安装脚本略有不同,在redhat上安装jdk时,建议自行google安装教程。我在redhat 6上安装时,参照该步骤发现总是安装不正确,最后发现是profile文件最后加的一段代码的问题,教训。 10 centos 安装maven [admin@localhost Downloads]$ tar -zxvf apache-maven-3.3.9-bin.tar.gz apache-maven-3.3.9/lib/ext/README.txt [root@localhost Downloads]# mv apache-maven-3.3.9 /usr/share [root@localhost Downloads]# vim /etc/profile 打开之后在末尾添加 export PATH=/usr/local/apache-maven-3.3.9/bin:$PATH [root@localhost java]# source /etc/profile [root@localhost java]# mvn -v Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00) Maven home: /usr/share/apache-maven-3.3.9 Java version: 1.7.0_79,vendor: Oracle Corporation Java home: /usr/local/java/jdk1.7.0_79/jre Default locale: en_US,platform encoding: UTF-8 OS name: "linux",version: "3.10.0-123.el7.x86_64",arch: "amd64",family: "unix" [root@localhost java]# 14 centos安装mariadb: [admin@localhost ~]$ rpm -qa | grep mysql [root@localhost admin]# rpm -qa | grep mariadb mariadb-5.5.44-2.el7.centos.x86_64 mariadb-libs-5.5.44-2.el7.centos.x86_64 [root@localhost admin]# cd /etc/yum.repos.d [root@localhost yum.repos.d]# vi MariaDB.repo # 添加如下内容: # MariaDB 10.0 CentOS repository list - created 2013-08-23 13:08 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1.10/centos7-amd64/ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 [root@localhost yum.repos.d]# rpm -e mariadb [root@localhost yum.repos.d]# rpm -qa | grep mariadb mariadb-libs-5.5.44-2.el7.centos.x86_64 [root@localhost yum.repos.d]# rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64 [root@localhost yum.repos.d]# rpm -qa | grep mariadb [root@localhost yum.repos.d]# yum -y install MariaDB-client MariaDB-server MariaDB-devel Downloading packages: Total 60 kB/s | 157 MB 00:44:27 Installed: MariaDB-client.x86_64 0:10.1.10-1.el7.centos MariaDB-devel.x86_64 0:10.1.10-1.el7.centos MariaDB-server.x86_64 0:10.1.10-1.el7.centos Complete! [root@localhost yum.repos.d]# rpm -qa | grep MariaDB MariaDB-server-10.1.10-1.el7.centos.x86_64 MariaDB-common-10.1.10-1.el7.centos.x86_64 MariaDB-devel-10.1.10-1.el7.centos.x86_64 MariaDB-client-10.1.10-1.el7.centos.x86_64 [root@localhost yum.repos.d]# service mysql start [root@localhost yum.repos.d]# mysqladmin -u root password 'password' [root@localhost yum.repos.d]# mysql -u root -p Enter password: Server version: 10.1.10-MariaDB MariaDB Server Copyright (c) 2000,2015,Oracle,MariaDB Corporation Ab and others. MariaDB [(none)]> grant all privileges on *.* to 'root'@'%'identified by 'password' with grant option; Query OK,0 rows affected (0.25 sec) MariaDB [(none)]> flush privileges; Query OK,0 rows affected (0.07 sec) MariaDB [(none)]> exit; Bye [root@localhost yum.repos.d]# systemctl status mariadb.service 15 centos安装maven私服nexus [root@localhost admin]# cd /home/admin/Downloads [root@localhost Downloads]# tar zxvf nexus-2.12.0-01-bundle.tar.gz [root@localhost Downloads]# mv nexus-2.12.0-01 /usr/local/nexus [root@localhost bin]# cd /usr/local/nexus/bin [root@localhost bin]# ./nexus Usage: ./nexus { console | start | stop | restart | status | dump } [root@localhost bin]# lsof -i tcp:8081 [root@localhost bin]# ./nexus start **************************************** WARNING - NOT RECOMMENDED TO RUN AS ROOT **************************************** [root@localhost bin]# export RUN_AS_USER=root [root@localhost bin]# ./nexus start **************************************** WARNING - NOT RECOMMENDED TO RUN AS ROOT **************************************** Starting Nexus OSS... Started Nexus OSS. 16 查看占用8081端口的程序,关闭程序 [root@localhost bin]# lsof -i tcp:8081 [root@localhost bin]# ll /proc/4191 [root@localhost bin]# kill 4191 20 centos安装svn $ su $ yum install subversion $ svnserve --version $ cd /usr/local/svn $ svn help $ svn checkout https://xxxx/svn/Apps/trunk/ 21 安装系统实时监控工具Glances # yum install -y glances # glances 按下 ‘q‘ (‘ESC‘ 和 ‘Ctrl-C‘ 也可以) 退出 Glances 终端 22 linux查看系统32位还是64位 [admin@localhost ~]$ uname -a 23 centos安装R # tar -xzvf R-3.0.2.tar.gz # mv R-3.1.2 /usr/local # yum install gcc-gfortran # yum install gcc gcc-c++ # yum install readline-devel # yum install libXt-devel # cd /usr/local/R-3.0.2 # ./configure --enable-R-shlib --prefix=/usr/local/R-3.1.2 # make # make install # cd bin # ./R > x<-c(1,2,3) > x > install.packages('rJava') > q()

总结

以上是脚本之家为你收集整理的centos 7安装jdk1.7等常用开发工具全部内容,希望文章能够帮你解决centos 7安装jdk1.7等常用开发工具所遇到的程序开发问题。

如果觉得脚本之家网站内容还不错,欢迎将脚本之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您喜欢交流学习经验,点击链接加入脚本之家官方QQ群:1065694478