CentOS7 environment under VMware virtual machine installed jdk1.8

The second way we open today a virtual machine of white, how to build jdk environment under linux.

I. First, we need to download a transfer tool, XShell. Its role is to transfer files before windows and linux. (There is also a software Xftp, two are recommended to download, two each have their own use, but also can choose to download Home Edition, this version is free). Download URL: https://www.netsarang.com/

Need to use registered mail, and the download link will be sent to the mailbox. You can also click the link to download the following two:

XShell:https://www.netsarang.com/zh/downloading/?token=bmM3dklSbnRVLXBNOWxFaC1EX3Nid0BaVjZXVkJRQU51VHEtRi1PVm1MQUFR

Xftp:https://www.netsarang.com/zh/downloading/?token=YVlKNGZoUFI4eXJvRUZsakM0YXFjQUBaVjZXVkJRQU51VHEtRi1PVm1MQUFR 

          

Two, Xshell configuration

After installation is complete, you need to XShell be configured to connect with linux. Proceed as follows:

(1) Click on the "New"

                                                           

 

(2) corresponding to the input parameters: The name can easily play host ip address is your virtual machine, the default port number, do not change, then click "OK"

   

(3) Then click on the "link" in the "User Authentication", a user name and password for the corresponding user name and password for your virtual machine, and then click "OK."

(4) After the first set, there will be the following pop, click on "Accept and Save"

                            

After that, each time you want to connect, produces the following dialog box, click on the "Connect" button

(5) a successful link

                          

Three, linux environment ready

1. To install the first command packet transmitted lrzsz, the following command: yum install lrzsz -y, FIG successful installation is the

安装完成后检测是否安装成功,命令如下:rpm -qa |grep lrzsz,如下图所示即为安装成功:

                                                     

2.安装vim包,一般来说,配置完linux后,vim都是没有安装的(或者没有完全安装)。

vim编辑器需要安装三个包: 
vim-enhanced-7.0.109-7.el5 
vim-minimal-7.0.109-7.el5 
vim-common-7.0.109-7.el5

我的虚拟机中只有一个vim-minimal-7.0.109-7.el5 ,因此为了方便把其他2个安装,我直接使用命令:yum -y install vim*,也可以分别安装单个包,如:yum -y install vim-enhanced

四、Windows传输文件到linux

1.首先先去官网下载你所需要的相应版本的jdk,一定要下载linux的压缩包,因为要传到linux后再解压https://www.oracle.com/technetwork/java/javase/downloads/index.html

             

2.在linux下创建一个文件夹,准备存放压缩包,命令如下:mkdir /usr/local/java

3.通过XShell将jdk传到linux,具体步骤 如下:

(1)保证XShell已经与linux连接,在linux下输入rz(传输命令):

                       

(2)然后在XShell下,点击“文件”——“传输”——“ZMODEM”——“用ZMODEM发送”,然后选择jdk文件即可

(3)稍等片刻,然后输入ls,可以查看文件是否传输成功,下图即成功:

                                   

(4)把jdk移动到我们刚刚自己创建的目录,命令:mv jdk-8u241-linux-x64.tar.gz /usr/local/java/

(5)进入我们刚刚自己创建的目录,命令:cd /usr/local/java/

(6)解压jdk,命令:tar -zxvf jdk-8u241-linux-x64.tar.gz

(7)解压后,进入到profile文件夹,设置环境变量,命令:vim /etc/profile

(8)在profile文件的末尾加入如下命令,然后保存
export JAVA_HOME=/usr/local/java/jdk1.7.0_55
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

#set java environment

(9)输入命令,使其生效:source /etc/profile

(10)java -version,查看是否安装成功,如下图所示即为成功:

     

发布了32 篇原创文章 · 获赞 17 · 访问量 4898

Guess you like

Origin blog.csdn.net/mango_ZZY/article/details/104045931