Install and configure JDK in CentOS7 to build an ftp server
. Set up an ftp server
We have installed the vsftpd server on CentOS. For details about how to install and configure the vsftpd server, refer to enable FTP and configure users in CentOS, install the LeapFTP client in Windows, and upload resources to the vsftpd server through LeapFTP, it is stored in the/var/ftp/pub path of CentOS by default.
2. Enable the ssh service
The CentOS ssh service is disabled by default. Use the service sshd start command to enable the CentOS ssh service. Install the putty client on Windows so that you can remotely control the CentOS system through putty.
3. Install jdk
Enter the command cd/var/ftp/pub to enter the pub directory. Enter the command ls to display all the files in pub. By default, the resource has no execution permission, so we need to enter the chmod + xjdk-8u45-linux-x64.rpm to grant the execution permission to the resource, enter the ls command again, if the target resource is green, it proves to have the execution permission.
Run the rpm-ivhjdk-8u45-linux-x64.rpm command to install jdk, the default installation path is/usr/java/java1.8.0 _ 45, in order to facilitate the later configuration, You can rename the file, enter the command mv/usr/java/java1.8.0 _ 45/usr/java/java1.8 to rename java1.8.0 _ 45 to java1.8.
4. Configure jdk Environment Variables
Run vi/etc/profile. By default, vi is in command mode. Enter command I and enter edit mode. Add the following content at the end of the profile:
[Html] view plaincopy
- JAVA_HOME =/usr/java/jdk1.8
- PATH = $ JAVA_HOME/bin: $ PATH
- CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
- ExportJAVA_HOME
- ExportPATH
- ExportCLASSPATH
After editing, Press ESC and enter: x to save and exit.
5. Test jdk
Enter the javac-version command. If the java version is displayed, the configuration is successful.