Before installing, download the following software

VirtureBox: www.virtualbox.org/

CentOS7 download address: link: pan.baidu.com/s/1X938d728… Extraction code: Q1HC

The JDK download address: link: pan.baidu.com/s/1PfiSyhrw… Extraction code: B3K3

Creating a VM

  • Open the Virtual Box, click “New”, click “Next”, and enter the vm name as CentOS7
  • Select Linux as the operating system, Red Hat-64bit as the version, and allocate 2048 MB memory (memory size depends on your requirements).
  • Use the default Settings for the following options. Finally, click the “Create” button to create the VM
  • Configure the VM NIC: Select the CREATED VM and click Settings. In the Network column, select Bridge NIC in connection Mode.
  • Click “Start” to install the system, select the downloaded CentOS7 file to install, the following all default options
  • After the installation, CentOS will remind you to reboot and click the “reboot” button

Operating System Settings

Configure the network
  • $: vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 Change ONBOOT to yes, save the configuration, and exit
  • $: service network restart Restarts the network
  • $: IP addr View the LOCAL IP address and record it
  • $: vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
ONBOOT = static IPADDR = 192.168.31.250 NETMASK = 255.255.255.0 GATEWAY = 192.168.31.1Copy the code
  • $: service network restart Restarts the NIC
Configure DNS
  • $: nmcli con mod enp0s3 ipv4. DNS “114.114.114.114 8.8.8.8
  • $: nmcli con Up enp0s3 Makes the DNS configuration take effect
  • $: ping www.baidu.com To check whether the ping succeeds
Disabling the Firewall
  • $: systemctl stop firewalld.service
  • $: systemctl disable firewalld.service
Configuration yum
  • $: yum clean all
  • $: yum makecache
  • $: yum install wget
Install the JDK
  • Upload the JDK file to the server
  • Install JDK: RPM -ivh JDK-8u131-linux-x64.rpm
  • Run the vi ~/.bashrc command to configure the environment variable
  • Add information
export JAVA_HOME=/usr/java/latest
export PATH=$PATH:$JAVA_HOME/bin
Copy the code
  • source .bashrc
  • Test whether JDK installation is successful: java-version