Install Java 9, 10, 11, or 12 on FreeBSD 11.1
Solution 1:
Java 11 & 12
OpenJDK 11 and 12 can now be found in the Ports tree. See:
- java/openjdk11
- java/openjdk12
An effort is underway to see future versions of OpenJDK for FreeBSD regularly made available alongside the other OSes such as macOS, Linux, AIX, etc.
Prior versions
During the time of Java 9 & 10 the BSD work was ongoing. While 9 & 10 were skipped, 11 & 12 are available now. Reminder: Java SE 11 is the Long-Term Support (LTS) version according to the new 6-month release cadence adopted by Oracle and the OpenJDK project.
Java 8 was released for BSD, and is available in the Ports tree.
As for running Oracle (Linux) Java - it is possible, but this JRE is unstable. For instance, installing MATLAB using it crashes the installer randomly during the process. However, your mileage may wary.