"Java is a programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture." — Wikipedia article
- 1 Installation
- 2 Troubleshooting
- 3 Tips and tricks
The only supported JVM implementation in Arch Linux is the open source OpenJDK. It is nearly perfect, and it should not be necessary to install Oracle's proprietary version of Java. If you want to install Oracle Java alongside OpenJDK, see #JDK-compat.
Install the OpenJDK Java runtime environment (JRE) with the package official repositories. There is also a Java development kit (JDK) available with the package ., available in the
Flagging packages as out-of-date
- IcedTea version (e.g.
2.4.3), rather than on their Oracle version (e.g.
, and should be flagged as out-of-date based on the
- IcedTea Web version (e.g.
1.4.1). This is independent of the IcedTea version. should be flagges as out-of-date based on the
Oracle Java SE
The Oracle implementations of JRE and JDK are available in the AUR: AUR and AUR.
Java SE 6
The AUR contains AUR and AUR, which are the Oracle implementations of Java SE 6.
The Oracle JDK (6 and 7) can also be installed in parallel with another Java installation (for example OpenJDK). The packages can be found in the AUR: AUR and AUR.
VMkit is an LLVM-based framework for JIT virtual machines. J3 is a JVM running on VMkit. The webpage can be found here: vmkit. J3 depends on the GNU classpath libraries, but may also work with the Apache class path libraries.
Parrot is a VM that offers experimental support for Java through two different methods: Either as a Java VM bytecode translator or as a Java compiler targeting the Parrot VM. is available in the official repositories and AUR in the AUR.
Due to the fact that the JDBC-drivers often use the port in the URL to establish a connection to the database, it is considered "remote" (i.e., MySQL does not listen to the port as per its default settings) despite the fact that they are possibly running on the same host, Thus, to use JDBC and MySQL you should enable remote access to MySQL, following instructions in MySQL article.
Java sound with Pulseaudio
By default, Java and Pulseaudio do not get along very well with each other, but this is easy to fix using padsp.
(These paths are correct for Sun's Java, you will need to change the paths for OpenJDK)
First, rename the
java binary to
# mv /opt/java/jre/bin/java /opt/java/jre/bin/java.bin
Then, create a new launcher script at
#!/bin/sh padsp /opt/java/jre/bin/java.bin "$@"
Finally, make the launcher script executable
# chmod +x /opt/java/jre/bin/java
You will need to redo this process on each update of Java.
You can also try replacing padsp with aoss, which can also fix it under standard ALSA as well as in Pulse, do what works best. I must warn everyone that these hacks sometimes work perfect, but are sometimes very unstable as well.
Impersonate Another Window Manager
$ wmname LG3D
(You must restart the application in question after issuing the wmname command.)
This works because the JVM contains a hard-coded list of known non-re-parenting window managers. For maximum irony, many users prefer to impersonate “
LG3D,” the non-re-parenting window manager written by Sun, in Java.
Fonts are Illegible
In addition to the suggestions mentioned below in #Better_font_rendering some fonts may still not be legible afterwards. If this is the case there is a good chance ms-fonts are being used. Install AUR from the AUR.
Tips and tricks
Behavior of most Java applications can be controlled by supplying predefined variables to Java runtime. From this forum post, a way to do it consists of adding the following line in your
/etc/profile.d/jre.sh to affect all users):
export _JAVA_OPTIONS="-D<option 1> -D<option 2>..."
For example, to use system anti-aliased fonts and make swing use the GTK look and feel:
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
Better font rendering
Both closed source and open source implementations of Java are known to have improperly implemented anti-aliasing of fonts. This can be fixed with the following options:
If your Java programs look ugly, you may want to set up the default look and feel for the swing components:
Some stubborn Java programs insist on using the cross platform Metal look and feel. In some of these cases you can force these apps to use the GTK look and feel by setting the following property:
Typically, OpenJDK installation creates symlinks in
/usr/bin for java, javac ... etc. If you want to change these symlinks to any other JDK (e.g. if you installed environment-compat packages of Oracle JDK), this script might be handy for you.