# Switch Hermes SEG to OS Based Java and Upgrade JRE

<p class="callout warning">Note: Java Version 10 is not currently supported on Hermes SEG. Hermes SEG has only been tested with Java 8.</p>

1. Login to console or SSH session.
2. Install JDK

```
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo apt-get -y install oracle-java8-installer
java -version
```

3. Stop Lucee

```
sudo service lucee_ctl stop
```

4. Remove JAVA\_HOME and JRE\_HOME from the lucee\_ctl init script

```
sudo sed -i -e 's/^\(JRE\|JAVA\)/#\1/g' /etc/init.d/lucee_ctl
```

5. Add the following to /opt/lucee/tomcat/bin/setenv.sh

```
sudo sed -i -e 's#CATALINA_OPTS#JAVA_HOME=/usr/lib/jvm/java-8-oracle\nexport CATALINA_OPTS#' /opt/lucee/tomcat/bin/setenv.sh
```

6. Start Lucee

```
sudo service lucee_ctl start
```

7. Verify it works

```
java -version 2>&1 | head -n 1 | awk -F '"' '{print $2}'
```

should output the latest Java version you installed above

```
1.8.0_181
```