Java πΈπ», I hate π€¬ you.
-
Download JDK: https://jdk.java.net/15/
-
Extract it & move to /Library/Java/JavaVirtualMachines/
tar -xvf openjdk-15.0.1_osx-x64_bin.tar
sudo mv jdk-15.0.1.jdk /Library/Java/JavaVirtualMachines
- Open .bash_profile and add the following entries at the end of it.
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home"
PATH="${JAVA_HOME}/bin:${PATH}"
export PATH
- Verify the JDK installation
java --version
-
Download Maven: https://maven.apache.org/download.cgi
-
Extract it & move to /opt
tar -xvf apache-maven-3.6.3-bin.tar
sudo mv apache-maven-3.6.3/ /opt
- Open .bash_profile and add the following entries at the end of it.
export PATH=/opt/apache-maven-3.6.3/bin:$PATH
- Verify the Maven installation
mvn --version
public class AwesomeJava {
public static void main(String[] args) {
System.out.println("Hello π Java. I love β€οΈ you.");
}
}