How to Install Java With Apt

Java and the JVM (Java Virtual Machine) are necessary for many kinds of software, including [Tomcat](http://tomcat.apache.org/), [Jetty](https://www.eclipse.org/jetty/), [Glassfish](https://javaee.github.io/glassfish/), [Cassandra](http://cassandra.apache.org/) and [Jenkins](https://jenkins.io/). In this guide, we’ll install various versions of the Java Runtime Environment (JRE) and the Java Developer Kit (JDK) on your server using `apt`. Choose your operating system below to get started.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.