Install and configure JDK in CentOS7 to build an ftp server

Source: Internet
Author: User

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
  1. JAVA_HOME =/usr/java/jdk1.8
  2. PATH = $ JAVA_HOME/bin: $ PATH
  3. CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
  4. ExportJAVA_HOME
  5. ExportPATH
  6. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.