From 7b4ca72ae440a0258b919a39f3f6e54347a24759 Mon Sep 17 00:00:00 2001 From: Kris Simon Date: Mon, 19 Jun 2023 08:31:21 +0200 Subject: [PATCH] =?UTF-8?q?ks=20|=C2=A0Set=20explicit=20java=20version=20t?= =?UTF-8?q?o=20JAVA=5FHOME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2ee2bc..18c61c2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,44 @@ # Java Standard Edition Set up Instructions The Java version that is used for the examples demonstrated on the Spark Shell is Java 8 (specifically "adoptopenjdk8" openjdk ). This can be installed on your machines using the below commands -``` +```shell brew tap AdoptOpenJDK/openjdk brew install --cask adoptopenjdk8 ``` Please also note that for the above command to work, homebrew package manager should be installed on your machines. Please refer to this [link](https://brew.sh/) to install it. +Test the currently active Java version: +```shell +java -version +``` + +The output should look something like this: +```text +openjdk version "1.8.0_292" +OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10) +OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode) +``` + +If the version `1.8.0_*` is not displayed, set the Java home to version 1.8: +```shell +# print out available versions +/usr/libexec/java_home -V +``` + +Output: +```text +Matching Java Virtual Machines (4): + 17.0.4 (arm64) "Amazon.com Inc." - "Amazon Corretto 17" /Users/_/Library/Java/JavaVirtualMachines/corretto-17.0.4.1/Contents/Home + 1.8.371.11 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home + 1.8.0_292 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK (JRE) 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jre/Contents/Home + 1.8.0_292 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home +``` + +Set an explicit version: +```shell +export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_292` +``` + # Python Set up Instructions The Python version used is the latest version that comes with Anaconda (it is most simple and hassle-free, isn't it ?). So go to the anaconda link [here](https://www.anaconda.com/) and install the latest version most suitable for your machine processor.Once done, open a terminal, type "python" and hit Enter. It should start a python shell.