2017-02-26 21:30:46 +00:00
+++
title = "Java"
+++
2017-02-03 08:38:34 +00:00
# Java
2017-01-05 02:56:10 +00:00
2017-02-10 14:45:40 +00:00
This article covers obtaining open source Java as well as Oracle Java.
2017-02-03 08:38:34 +00:00
## Installation
2017-01-05 02:56:10 +00:00
If you are looking for OpenJDK or OpenJRE, install `openjdk-8` from the repository. The instructions below are for Oracle Java.
You can set up Java by following the instructions below:
2017-02-03 08:38:34 +00:00
## JRE
2017-01-05 02:56:10 +00:00
Grab the Java Runtime Environment (JRE) as `.tar.gz` from the [Oracle Download Page ](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html ).
Extract JRE and move it to /opt:
2017-02-25 20:23:57 +00:00
``` bash
2017-01-05 02:56:10 +00:00
cd ~/Downloads
2017-02-15 05:30:39 +00:00
tar xf jre-8u121-linux-x64.tar.gz
sudo mv jre1.8.0_121 /opt/
sudo ln -svf /opt/jre1.8.0_121/bin/java /usr/bin/java
```
To enable Java in Firefox:
2017-02-25 20:23:57 +00:00
``` bash
2017-02-15 05:30:39 +00:00
mkdir -p ~/.mozilla/plugins
ln -s /opt/jre1.8.0_121/lib/amd64/libnpjp2.so ~/.mozilla/plugins/libnpjp2.so
2017-01-05 02:56:10 +00:00
```
2017-02-03 08:38:34 +00:00
## JDK
2017-01-05 02:56:10 +00:00
Grab the Java Development Kit (JDK) as `.tar.gz` from the [Oracle Download Page ](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html ).
Extract JDK and move it to /opt:
2017-02-25 20:23:57 +00:00
``` bash
2017-01-05 02:56:10 +00:00
cd ~/Downloads
2017-02-15 05:30:39 +00:00
tar xf jdk-8u121-linux-x64.tar.gz
sudo mv jdk1.8.0_121 /opt/
sudo ln -svf /opt/jdk1.8.0_121/bin/java /usr/bin/java
```
To enable Java in Firefox:
2017-02-25 20:23:57 +00:00
``` bash
2017-02-15 05:30:39 +00:00
mkdir -p ~/.mozilla/plugins
ln -s /opt/jdk1.8.0_121/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/libnpjp2.so
2017-01-05 02:56:10 +00:00
```