Skip to content

Latest commit

 

History

History
101 lines (68 loc) · 2.75 KB

File metadata and controls

101 lines (68 loc) · 2.75 KB

Java

Clojure is a hosted language, so we need to install a Java run-time environment (JRE). Java is typically installed on all modern operating systems.

Install Java

{% tabs first="Debian/Ubuntu", second="Homebrew", third="Chocolatey", forth="Manual" %}

{% content "first" %}

Open a terminal and run the following command (you will be prompted for your login password to complete the install)

sudo apt-get install openjdk-8-jre

Hint:: openjdk-8 not available?

If openjdk-8 is not available, add the WebUpd8 Java personal package archive

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

Hint::Switching between Java versions

If you have more than one version of Java installed, set the version by opening a terminal and using the following command

sudo update-alternatives --config java

Available java versions will be listed. Enter the list number for the version you wish to use.

{% content "second" %}

If you use Homebrew, then run the following commands in a terminal:

brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk-openjdk8

Hint::Swithching between Java versions

You can run more than one version of Java on MacOS. Set the Java version by opening a terminal and using one of the following commands

List Java versions installed

/usr/libexec/java_home -V

Switch to Java version 1.8 (recommended)

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

Change back to Java version 11 (not recommended)

export JAVA_HOME=$(/usr/libexec/java_home -v 11)

{% content "third" %}

Chocolatey is a package manager for Windows (similar to Homebrew for MacOSX)

Install the Java Runtime (JRE) using the following commands in a command window

choco install javaruntime

{% content "forth" %}

Download OpenJDK 8

Adopt OpenJDK webpage

Run the file once downloaded and follow the install instructions.

{% endtabs %}

Check Java is working

Open a terminal and run the command

java -version

If Java is installed, you will see something like this in your terminal:

Java version

The details of Java's version may differ from what you see above; that is perfectly fine, so long as you have Java version 8 or above.