Java on Fedora

Fedora uses a Free software stack that consists of OpenJDK, GNU Compiler for Java, GNU classpath and the Eclipse Java compiler to implement Java. See our JavaFAQ for more information on that. Note that AOT compilation using GCJ has been deprecated (made optional) and new packages or updated ones will be built with OpenJDK in a regular Java compilation to bytecodes.

Software mentioned on this page may come in different packaging formats. Fedora's own packages (RPM) are easy to install (with Yum) and installation instructions can be found from Docs/Drafts/SoftwareManagementGuide. Third party packages may be in archive formats (.zip, tar) and then case specific instructions should be provided.

Terminology

In Java context, terms may be a bit confusing for newcomers. JRE (Java Runtime Environment) stands for virtual machine, which is able to run Java programs.

JDK (Java Development Kit) or SDK (Software Developmenet Kit) is needed to develop Java programs. Many SDK packages these days also ship JRE, or to confuse more, no separate JRE is provided and thus terminal installations are supposed to include the development environment.

Java Runtime Environments (JRE)

Java's history is well known to consist different JRE implementations and wide variety of combinations which work together. Different implementations can be installed simultaneously to Fedora and activated one at the time. Activation is done using the Alternatives system (also used to change some other subsystems). Java's subsystem name is surprisingly java and typical commands include:

# alternatives --display java

# alternatives --config java

See alternative's own documentation for more information for usage and parts involved.

Should be noted that JRE implementations installed outside Fedora distribution, may not support alternatives and thus not be visible there. Then the symbolic links under directory /etc/alternatives must be manually fixed.

OpenJDK and project IcedTea

Fedora has shipped OpenJDK as default JRE implementation since Fedora release 9. It's based on Sun Microsystem's JavaOne open source release and complemented by Red Hat's IcedTea project that implements the missing third party components that Sun could not release under free License.

OpenJDK package name on Fedora is java-1.6.0-openjdk.

GNU GCJ+GIJ for Java

The GNU Project's Java compiler and interpreter implementations provide a working JRE environment. GCJ is a Java compiler that produces bytecode for Java virtual machine GIJ.

Troubleshooting JRE

For all Java subsystem debugging, installing the symbols package java-1.6.0-openjdk-debuginfo is essential. All debuginfo sub-packages reside in own repository which needs to be enabled for installation at least. An example yum command:

This will write the standard output also to a file which can be attached to a bug reports.

OpenJDK does not ship the Java console anymore, but one can be found from Firefox Web Developer add-on which is installed separately to the Firefox. Add-ons are installed using Firefox's own software component management system, not Fedora's RPM.

Java Develoment Tools (SDK)

Eclipse

See our Eclipse page for an integrated development environment platform that itself is written in Java and has plugin support for many programming languages.

Maven

Fedora includes a somewhat customized version of Maven in the distribution. The customization is purely to make Maven work well in offline mode with the rest of the system. Details on how packagers can use this customized Maven are located at Java/JPPMavenReadme . We are in the process of upgrading from maven2 2.0.4 to maven2 2.0.8 (ETA = F12). Once that is achieved we will proceed immediately to maven2 2.0.9 and then to 2.0.10. The reason for going by steps is that it is easier to bootstrap a maven2 release from the previous one. Also related to maven2, a feasibility study is being performed to change the installation of Java packages to become a valid maven2 repository. We will no longer have to modify maven2 (not even with our small patch), and it wil be easier to support parallel installation of either "legacy" or "progressive" versions of Java packages. Once some positive results are obtained, it will be discussed on the fedora-devel-java-list.