linux configuration jdk, jenkins

A. Installing jdk

The main purpose of automated testing is to perform regression testing. Of course, in order to simulate real user actions, usually regression testing in UAT or production environment.

In order to avoid internal network and external networks to resolve the impact of the test results, test automation service deployment outside the network server is a better choice.

Today's test application server down, Ali cloud of Linux servers, for my people who rarely use Linux, installation tools let me hurt (or too much food, ah ...)

This blog, the next step of finishing the basic installation for Linux like me white reference. . .

 

1. Prepare the servers

This according to individual circumstances, you can install a virtual machine can also rent the server from the cloud service provider;

My server version: CentOS7.4 64 Wei

Connection Kit: Xshell

Specific connection tools can refer to this blog: Common connection Linux tools

 

2, view the available versions of JDK

After a successful login server, enter the following command to see JDK version supported:

 yum -y list java* 

After the successful implementation, the interface is shown below:

Because the server version is 64-bit, I want to install a JDK 1.8, so select the version of the image above marked out, for installation;

PS: with -devel is installed jdk, WITHOUT -devel actually installed the jre!

 

3, install JDK

Enter the following command, wait for the installation to complete:

 yum install -y java-1.8.0-openjdk-devel.x86_64 

After the installation is successful, the interface is shown below:

 

4, verify the installation

Enter the command:  the Java -version, see if the installation was successful. I installed the 1.8 version of the JDK, the results appear as follows:

This information appears, it means JDK installed successfully.

 

5, see the JDK version information

If you want to see the JDK installation information, you can enter the following command to see:

 cd /usr/lib/jvm 

Enter the installation directory, enter the following:

 ls 

Interface is shown below:

 

6, configure the default JDK version

If a number of different versions of the JDK you installed, you can view JDK installed by the following command:

 sudo update-alternatives --config java 

显示界面如下:

如果要保持当前的版本【*】不变,请按回车键,入过要选择其他版本,请输入编号。

参考文档:https://www.cnblogs.com/zhangxue521/p/8336216.html

二.安装jenkins

选择最新版 ,使用yum方式下载安装
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
3、接下来配置jenkins端口
vi /etc/sysconfig/jenkins
查找/JENKINS_PORT,修改JENKINS_PORT="8080",默认为“8080”,我修改为了8081

自动安装完成之后:
/usr/lib/jenkins/jenkins.war    WAR包
/etc/sysconfig/jenkins       配置文件
/var/lib/jenkins/       默认的JENKINS_HOME目录
/var/log/jenkins/jenkins.log    Jenkins日志文件

4、启动jenkins
输入service jenkins restart
启动Jenkins遇到了java.awt.headless问题

我打开任何显示趋势图的Jenkins页面。我在页面上收到以下错误:
您需要在无头模式下运行Web容器。将-Djava.awt.headless = true添加到VM。
使用的是OpenJDK Headless软件包(至少在CentOS 7上),则需要安装fontconfig
最后执行这个命令搞定
sudo yum install fontconfig

在浏览器中输入访问http://ip:8848

要求输入密码 cat  /var/lib/jenkins/secrets/initialAdminPassword

开始安装插件

 

Guess you like

Origin www.cnblogs.com/fcc-123/p/11586707.html