---
title: "FreeBSD Java® Project"
sidenav: developers
---

include::shared/en/urls.adoc[]

= FreeBSD Java(R) Project

[.right]
image::../gifs/j2j.gif[Jump to Java(R)]

== Getting Java

There are two choices of Java Development Kits on FreeBSD:

=== OpenJDK

The OpenJDK(R) project provides a native open-source implementation of the Java(R) SE Platform. It is available for all currently supported FreeBSD releases in the following combinations of versions (by architecture):

*aarch64*: `openjdk8`, `openjdk11`, `openjdk12`, `openjdk13`

*amd64*: `openjdk7`, `openjdk8`, `openjdk11`, `openjdk12`, `openjdk13`

*arm6*: `openjdk8`

*arm7*: `openjdk8`

*i386*: `openjdk7`, `openjdk8`, `openjdk11`, `openjdk12`, `openjdk13`

*powerpc*: `openjdk8`

*powerpc64*: `openjdk8`, `openjdk11`, `openjdk12`, `openjdk13`

OpenJDK(R) is frequently updated, and it is suggested to refer to https://svnweb.freebsd.org/ports/head/java/[revision logs] for detailed release history. Additionally, one may choose to review more information at https://www.freshports.org/search.php?query=openjdk&search=go&num=10&stype=name&method=match&deleted=excludedeleted&start=1&casesensitivity=caseinsensitive[FreshPorts].

To install OpenJDK(R) package use the link:https://www.freebsd.org/cgi/man.cgi?query=pkg[`pkg`] utility or the ports system:

`pkg install openjdk[version]`

or

`cd /usr/ports/java/openjdk[version]`

`make install clean`

where [version] is one of 7, 8, 11, 12, or 13. An example (`openjdk11`):

`pkg install openjdk11`

or

`cd /usr/ports/java/openjdk11`

`make install clean`

=== Oracle JDK for Linux

This port installs the Java Development Kit from Oracle which was built for Linux. It will run under FreeBSD using the Linux compatibility.

`pkg install linux-oracle-jdk18`

or

`cd /usr/ports/java/linux-oracle-jdk18`

`make install clean`

*Note:* Please note that due to the current licensing policy the Oracle JDK on FreeBSD binaries can not be distributed and you are only permitted to use them personally. For the same reason, the sources must be fetched manually.

== Documentation

* link:{porters-handbook}#using-java[Creating Ports]

== I want to help by...

=== ... fixing bugs or adding new features

The main repositories for the BSD port of OpenJDK are publically available on Github. Pull requests are welcome. You can find more information on this https://wiki.freebsd.org/Ports/openjdk_11[Wiki]

=== ... testing

The best thing you can do is download the latest release, install it, and try all your favorite Java applications. If they don't work, see below.

=== ... reporting a bug

If you find an application that does not work, or crashes, here are the steps you should follow before reporting it:

. Try it again.
. Check your settings for this application. Check to see if you made a mistake in starting it up.
. Try it on a different platform. If you have access to a reference platform, try it there. (We need to determine if it is an application error, a Java bug, or a FreeBSD specific bug.)
. Narrow down the problem. If it is your own code, narrow down the bug to the offending code. Otherwise, determine the steps required to reproduce the problem.
. Notify the JDK porting team. Send email to freebsd-java@FreeBSD.org. Be sure to include the steps you have followed.
. Finally, and most importantly, be willing to work with the team to fix the problem.

=== ...writing documentation

Everyone can help here. If you have a suggestion to add to the documentation, write it up and send it to freebsd-java@FreeBSD.org
