For additional help or useful information, we recommend you check the official Apache Maven website. Either set the JAVAHOME environment variable pointing to your JDK installation or have the java executable on your PATH. Thanks for using this tutorial for installing Apache Maven on CentOS 8 system. If you are already installed Java JDK and you want to update it, you can start from Section 0.Section 0.
Java and maven install centos install#
OS name: "linux", version: "4.16.0-80.7.1.el8_0.x86_64", arch: "amd64", family: "unix"Ĭongratulations! You have successfully installed Apache Maven. Java JDK On CentOs we need to install JDK for some programs like Ant, Maven and etc.
Java version: 11.0.5, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk-11.0.5.10-0.el8_0.x86_64ĭefault locale: en_US, platform encoding: UTF-8 Daniel Mach <> - 2.4-7 - Mass rebuild - Michal Srb <> - 2.4-6 - Migrate away from mvn-rpmbuild (Resolves: 997497) - Mikolaj Izdebski <> - 2.4-5 - Rebuild to regenerate API documentation - Resolves: CVE-2013-1571.yum -y install java-1.8.0-openjdk-devel Run the following command to verify the installation of Java.
Java and maven install centos how to#
Once everything has been successfully configured, check the version of the Apache Maven: $ mvn -versionĪpache Maven 3.6.3 (cecedd343adsensegoalbb50b32b541b8a6ba2883f) READ: How To Install Oracle Java 11 / 8 CentOS 7 / RHEL 7 OR If you plan to use OpenJDK for Maven, then you can just use the YUM command to install it. Now load the environment variables in the current shell using the following command: source /etc/profile.d/maven.sh
![java and maven install centos java and maven install centos](https://metavrse.files.wordpress.com/2017/02/environmental-variables-required-for-maven.jpg)
Make the script executable by running the following chmod command: sudo chmod +x /etc/profile.d/maven.sh Either set the JAVAHOME environment variable pointing to your JDK installation or have the java executable on your PATH.
![java and maven install centos java and maven install centos](https://img0.developpaper.com/2019/01/143096935-5c2d95d37c617_articlex.png)
Detailed steps are: Have a JDK installation on your system. Now set the environments variables by creating a new file /etc/profile.d/maven.sh: sudo nano /etc/profile.d/maven.shĪdd the following content: export JAVA_HOME=/usr/lib/jvm/jre-openjdk Installing Apache Maven The installation of Apache Maven is a simple process of extracting the archive and adding the bin folder with the mvn command to the PATH. We also create a symbolic link maven that will point to the Maven installation directory: sudo ln -s /opt/apache-maven-3.6.3 /opt/maven Sudo tar xf /tmp/apache-maven-3.6. -C /opt