To install and configure Maven 3.9.2 on CentOS 7 system, you can follow the steps below:
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.
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.
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.
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.
Configure Maven environment variables. Edit /etc/profile
file:
sudo vi /etc/profile
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.
Refresh environment variables. Execute the following command:
source /etc/profile
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!