Install JDK 11 & Apache Maven 3.6

Introduction

The JDK is a key platform component for building Java applications. At its heart is the Java compiler. The Java Development Kit (JDK) is one of the three core technology packages used in Java programming.

Learn more: https://en.wikipedia.org/wiki/Java_Development_Kit

What is Apache Maven?

Apache Maven is a software project management and comprehension tool.

JDK

  • Oracle JDK
  • OpenJDK Build by Oracle
  • AdoptOpenJDK Build
  • AdoptOpenJDK OpenJ9 Build
  • Red Hat OpenJDK Build
  • Azul Zulu
  • Amazon Corretto

JDK 11 installation (OpenJDK) On Mac

  1. Download pkg
  2. Set up Path (Mac)

1. Download pkg

https://adoptopenjdk.net/releases.html

2. Set up Path (Mac)

Add Path to .bash_profile or .zprofile

$ vi ~/.bash_profile
$ vi ~/.zprofile
# JAVA HOME
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home"
export PATH=$PATH:${JAVA_HOME}/bin
$ echo $PATH
/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin
$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)

Install Apache Maven 3.6

  1. Download binary
  2. Set up Path (Mac)

Install Apache Maven with brew

brew install maven 

1. Download binary

https://maven.apache.org/download.cgi

2. Set up Path (Mac)

  1. Choose file Location and unzip file
$ cd /Library/
$ pwd
/Library

unzip in /Library or where you want

$ pwd 
/Library/apache-maven-3.6.3

2. Add Path to .bash_profile or .zprofile

The most recent Mac version terminal’s absolute path is zsh. However, If you want to use bash, you can change zsh to bash or bash to zsh.https://anote.dev/moving-from-zsh-to-bash-terminal-change/

$ vi ~/.bash_profile
# MVM 
export MVN=$"/Library/apache-maven-3.6.3" 
export PATH=$PATH:${MVN}/bin
$ echo $PATH
/Library/apache-maven-3.6.3/bin
$ mvn -v 
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /Library/apache-maven-3.6.3 
Java version: 11.0.8, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-
11.jdk/Contents/Home Default locale: ko_KR, platform encoding: UTF-8 OS name: "mac os x", version: 
"10.15.6", arch: "x86_64", family: "mac"

Leave a Reply

Your email address will not be published.

ANOTE.DEV