How to Install Apache Maven on CentOS 7
- Category : Linux Helpline (Easy Guide)
- Posted on : Jan 05, 2019
- Views : 1,619
- By : Hagen V.
Maven is a automation tool used to build and manage projects written in C, ruby language, In this blog, I will explain that how to install and configure latest version of Apache Maven on a CentOS 7.
Requirement
CentOS 7 Server
Root privileges
# steps:
Install Java OpenJDK on CentOS 7
Download Apache Maven Binary Files from source file
Configure Apache Maven Environment on centos
First. You need to install the Java on the CentOS 7 server. The apache Maven requires JDK 1.7 or above. So, please install the java software package “java-1.8.0-openjdk-devel “on this server.
# yum install -y java-1.8.0-openjdk-devel
# java -version
If installation is success, you see the following output.
# java -version
openjdk version "1.8.0_201"
OpenJDK Runtime Environment (build 1.8.0_201-b09)
OpenJDK 64-Bit Server VM (build 25.201-b09, mixed mode)
Please download Apache maven from its official website or use following link to download Maven 3.5.4. package to directory /usr/local/src
# cd /usr/local/src
# wget http://www-us.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
After that, extract downloaded file using following command.
# tar -xf apache-maven-3.5.4-bin.tar.gz
# mv apache-maven-3.5.4/ apache-maven/
To configure the environments variables to Apache Maven files, you need to create file ‘maven.sh’ in the ‘/etc/profile.d’ directory
# cd /etc/profile.d/
# vim maven.sh
Add the following configuration in maven.sh file
export M2_HOME=/usr/local/src/apache-maven
export PATH=${M2_HOME}/bin:${PATH}
To load the added configuration by using the ‘source’ command.
# chmod +x maven.sh
# source /etc/profile.d/maven.sh
After that, you need to check that Apache Maven installation is successfully or not , run the following maven command.
# mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Maven home: /usr/local/src/apache-maven
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-43-generic", arch: "amd64", family: "unix"
Categories
- cPanel Question 47
- cPanel Software Management 29
- cPanel Tutorials 13
- Development 29
- Domain 13
- General 19
- Linux Helpline (Easy Guide) 156
- Marketing 47
- MySQL Question 13
- News 2
- PHP Configuration 14
- SEO 4
- SEO 42
- Server Administration 84
- SSL Installation 54
- Tips and Tricks 24
- VPS 3
- Web Hosting 44
- Website Security 22
- WHM questions 13
- WordPress 148
Subscribe Now
10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!Archive Calendar
Sat | Sun | Mon | Tue | Wed | Thu | Fri |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Recent Articles
-
Posted on : Sep 17
-
Posted on : Sep 10
-
Posted on : Aug 04
-
Posted on : Apr 01
Tags
- ts
- myisam
- vpn
- sql
- process
- kill
- tweak
- server load
- attack
- ddos mitigation
- Knowledge
- layer 7
- ddos
- webmail
- DMARC
- Development
- nginx
- seo vpn
- Hosting Security
- wireguard
- innodb
- exim
- smtp relay
- smtp
- VPS Hosting
- cpulimit
- Plesk
- Comparison
- cpu
- encryption
- WHM
- xampp
- sysstat
- optimize
- cheap vpn
- php-fpm
- mariadb
- apache
- Small Business
- Error
- Networking
- VPS
- SSD Hosting
- Link Building
- centos
- DNS
- optimization
- ubuntu