Home >Computer Tutorials >Computer Knowledge >Baidu search: Lan Yiyun [Linux (CentOS7) system installation and configuration Maven3.9.2 tutorial]

Baidu search: Lan Yiyun [Linux (CentOS7) system installation and configuration Maven3.9.2 tutorial]

PHPz
PHPzforward
2024-03-27 18:16:361214browse

Baidu search: Lan Yiyun [Linux (CentOS7) system installation and configuration Maven3.9.2 tutorial]

To install and configure Maven 3.9.2 on CentOS 7 system, you can follow the steps below:

  1. Log in to your CentOS 7 server.
  2. Open a terminal and execute the following command to install Java Development Kit (JDK):

    sudo yum install java-1.8.0-openjdk-devel

    This will install OpenJDK 8 as the Maven runtime environment.

  3. Download the Maven 3.9.2 compressed package. You can check the Maven official website (

    ) to find the download link for the latest version. Execute the following command in the terminal to download:

    wget [Maven下载链接]

    Replace
    [Maven download link] with the download link of Maven 3.9.2.

  4. Decompress the Maven compressed package. Execute the following command:

    tar xvf [Maven压缩包文件名]

    Replace
    [Maven compressed package file name] with the file name of the Maven compressed package you downloaded.

  5. Move Maven to the appropriate directory. Execute the following command:

    sudo mv [Maven目录] /usr/local

    Replace
    [Maven Directory] with the full path to the unzipped Maven directory.

  6. Configure Maven environment variables. Edit
    /etc/profile file:

    sudo vi /etc/profile
  7. Add the following lines at the end of the file to set Maven's environment variables:

    export MAVEN_HOME=/usr/local/[Maven目录]
    export PATH=$MAVEN_HOME/bin:$PATH

    Replace
    [Maven Directory] with the full path to where you moved Maven in step 5.

  8. Save and close the file.
  9. Refresh environment variables. Execute the following command:

    source /etc/profile
  10. Verify whether the Maven installation is successful. Execute the following command:

    mvn -version

    If the installation is successful, the Maven version information will be displayed.

Now, you have successfully installed and configured Maven 3.9.2 on your CentOS 7 system. You can use Maven to build and manage Java projects.

The above is the detailed content of Baidu search: Lan Yiyun [Linux (CentOS7) system installation and configuration Maven3.9.2 tutorial]. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete