https://wiki.archlinux.org/api.php?action=feedcontributions&user=Teh5abiking&feedformat=atomArchWiki - User contributions [en]2024-03-28T15:41:04ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Java&diff=193724Java2012-04-10T20:03:02Z<p>Teh5abiking: /* Oracle JVM */</p>
<hr />
<div>[[Category:Development (English)]]<br />
{{i18n|Java}}<br />
[[fr:Java]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|This article explains how to install and configure JRE/JDK.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Java Package Guidelines}}<br />
{{Article summary end}}<br />
<br />
"''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.''" &mdash; [[Wikipedia:Java (programming language)|Wikipedia article]]<br />
<br />
== Installation ==<br />
The only JVM implementation in supported repositories is the open source [http://openjdk.java.net/ OpenJDK]. Additional Java implementations are available via the [[AUR]]. Keep in mind that the open-source and closed-source versions cannot be installed simultaneously. The open-source version is nearly perfect at the time of writing, and there is mostly no need anymore to install Oracle's proprietary version of Java.<br />
<br />
=== OpenJDK JVM ===<br />
To be able to run Java programs, you can install [[Wikipedia:JRE|Java runtime]] with the package {{Pkg|jre7-openjdk}}, available in the [[official repositories]]. There is also a [[Wikipedia:JDK|Java Development Kit]] in {{Pkg|jdk7-openjdk}}. For those interested in the old Java v6, both JRE6 and JDK6 can be found in {{Pkg|openjdk6}}.<br />
<br />
You will likely need the {{Pkg|icedtea-web-java7}} package for Java functionality in browsers, namely [[Wikipedia:Java applet|applets]] and [[Wikipedia:Java Web Start|Web Start]] (for more details see [[Browser Plugins#Java]]).<br />
<br />
{{Note|If you use a non-reparenting window manager and Java 6, you should uncomment the corresponding line in {{Ic|/etc/profile.d/openjdk6.sh}}}}<br />
<br />
=== Oracle JVM ===<br />
Prior to the [http://mailman.archlinux.org/pipermail/arch-general/2011-August/021671.html retirement of the Oracle DLJ], it was possible to simply install the {{Ic|jre}} and {{Ic|jdk}} packages from the repositories. However, now Arch Linux (and any other GNU/Linux distribution) can no longer package the Oracle implementation of Java. The OpenJDK packages are the recommended providers of {{Ic|java-runtime}} and {{Ic|java-environment}}.<br />
<br />
AUR contains packages for {{AUR|jre}} and {{AUR|jdk}}, the Oracle implementations of Java.<br />
<br />
{{Note|You will need to ensure that {{Ic|/opt/java/jre/bin/}} is in your {{Ic|$PATH}} variable, and that {{Ic|$JAVA_HOME}} points to the correct position (generally {{Ic|/opt/java}}). You can do this by either logging out and in again, or by sourcing {{Ic|/etc/profile}}.}}<br />
<br />
=== Oracle JVM (Java 6) ===<br />
<br />
Seeing as how {{AUR|jre}} and {{AUR|jdk}} have been updated to Java SE 7, the installation of Java SE 6, the older reference implementation of Java can't be installed through the AUR. However, it can be installed manually. To do so, consult the article [[Java SE 6]] for instructions on how to do so manually.<br />
<br />
=== Apache Harmony ===<br />
[http://harmony.apache.org/ Apache Harmony] is a clean room re-implementation of the Java language and comes under the Free Apache license. A binary re-distribution of the Harmony JRE can be found in the AUR: {{AUR|apache-harmony-jre}}.<br />
<br />
=== Kaffe ===<br />
[http://www.kaffe.org/ Kaffe] is another clean-room implementation of a Java VM without official endorsement from Sun/Oracle. A [[git]] package of Kaffe can be found in the [[AUR]] here: {{AUR|kaffe-git}}. The Kaffe VM is redistributed according to the GPL license.<br />
<br />
=== BEA JRockit JIT JVM (+JDK) ===<br />
[[Wikipedia:JRockit|JRockit]] is JIT version of Java, provided by Oracle and available from the AUR here: {{AUR|jrockit}}.<br />
<br />
=== VMkit LLVM-based JIT VM ===<br />
[http://vmkit.llvm.org/index.html VMkit] is an LLVM-based framework for JIT virtual machines. J3 is a JVM running on VMkit. A broken build for VMkit can be found in the [[AUR]] here: {{AUR|vmkit-svn}}. J3 depends on the GNU classpath libraries, but may also work with the Apache class path libraries.<br />
<br />
=== Parrot VM ===<br />
The [http://www.archlinux.org/packages/?q=parrot Parrot VM] offers experimental [http://trac.parrot.org/parrot/wiki/Languages support for Java] through two different methods: Either as a [http://code.google.com/p/parrot-jvm/ Java VM bytecode translator] or as a [https://github.com/chrisdolan/perk Java compiler targeting the Parrot VM]. Available in the AUR package {{AUR|parrot-git}}.<br />
<br />
== Troubleshooting ==<br />
=== MySQL ===<br />
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#Enable remote access|MySQL article]].<br />
<br />
=== Java sound with Pulseaudio ===<br />
{{Note|This procedure is likely to be relevant for previous version of Java (Java 6) only.}}<br />
<br />
By default, Java and [[Pulseaudio]] do not get along very well with each other, but this is easy to fix using padsp.<br />
<br />
(These paths are correct for Sun's Java, you will need to change the paths for OpenJDK)<br />
<br />
First, rename the {{Ic|java}} binary to {{Ic|java.bin}}<br />
# mv /opt/java/jre/bin/java /opt/java/jre/bin/java.bin<br />
Then, create a new launcher script at {{Ic|/opt/java/jre/bin/java}}<br />
#!/bin/sh<br />
padsp /opt/java/jre/bin/java.bin "$@"<br />
Finally, make the launcher script executable<br />
# chmod +x /opt/java/jre/bin/java<br />
You will need to redo this process on each update of Java.<br />
<br />
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.<br />
<br />
== Tips and tricks ==<br />
{{Note|Suggestions in this section are applicable to all applications, using explicitly installed (external) Java runtime. Some applications are bundled with own (private) runtime or use own mechanics for GUI, font rendering etc, so none of written below is guaranteed to work.}}<br />
<br />
Behavior of most Java applications can be controlled by supplying predefined variables to Java runtime. From [https://bbs.archlinux.org/viewtopic.php?id=72892 this forum post], a way to do it consists of adding the following line in your {{Ic|~/.bashrc}} (or {{Ic|/etc/profile.d/jre.sh}} to affect all users):<br />
<br />
export _JAVA_OPTIONS="-D'''<option 1>''' -D'''<option 2>'''..."<br />
<br />
=== Better font rendering ===<br />
Both closed source and open source one implementations of Java are known to have improperly implement antialiasing of fonts. This can be fixed with following options: {{Ic|1=awt.useSystemAAFontSettings=on}}, {{Ic|1=swing.aatext=true}}<br />
<br />
=== GTK LookAndFeel ===<br />
If your java programs look ugly, you may want to set up the default look and feel for the swing components: {{Ic|1=swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel}}.</div>Teh5abikinghttps://wiki.archlinux.org/index.php?title=Java&diff=193721Java2012-04-10T19:29:49Z<p>Teh5abiking: /* Java SE 6 (Oracle JVM) */</p>
<hr />
<div>[[Category:Development (English)]]<br />
{{i18n|Java}}<br />
[[fr:Java]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|This article explains how to install and configure JRE/JDK.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Java Package Guidelines}}<br />
{{Article summary end}}<br />
<br />
"''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.''" &mdash; [[Wikipedia:Java (programming language)|Wikipedia article]]<br />
<br />
== Installation ==<br />
The only JVM implementation in supported repositories is the open source [http://openjdk.java.net/ OpenJDK]. Additional Java implementations are available via the [[AUR]]. Keep in mind that the open-source and closed-source versions cannot be installed simultaneously. The open-source version is nearly perfect at the time of writing, and there is mostly no need anymore to install Oracle's proprietary version of Java.<br />
<br />
=== OpenJDK JVM ===<br />
To be able to run Java programs, you can install [[Wikipedia:JRE|Java runtime]] with the package {{Pkg|jre7-openjdk}}, available in the [[official repositories]]. There is also a [[Wikipedia:JDK|Java Development Kit]] in {{Pkg|jdk7-openjdk}}. For those interested in the old Java v6, both JRE6 and JDK6 can be found in {{Pkg|openjdk6}}.<br />
<br />
You will likely need the {{Pkg|icedtea-web-java7}} package for Java functionality in browsers, namely [[Wikipedia:Java applet|applets]] and [[Wikipedia:Java Web Start|Web Start]] (for more details see [[Browser Plugins#Java]]).<br />
<br />
{{Note|If you use a non-reparenting window manager and Java 6, you should uncomment the corresponding line in {{Ic|/etc/profile.d/openjdk6.sh}}}}<br />
<br />
=== Oracle JVM ===<br />
Prior to the [http://mailman.archlinux.org/pipermail/arch-general/2011-August/021671.html retirement of the Oracle DLJ], it was possible to simply install the {{Ic|jre}} and {{Ic|jdk}} packages from the repositories. However, now Arch Linux (and any other GNU/Linux distribution) can no longer package the Oracle implementation of Java. The OpenJDK packages are the recommended providers of {{Ic|java-runtime}} and {{Ic|java-environment}}.<br />
<br />
AUR contains packages for {{AUR|jre}} and {{AUR|jdk}}, the Oracle implementations of Java.<br />
<br />
{{Note|You will need to ensure that {{Ic|/opt/java/jre/bin/}} is in your {{Ic|$PATH}} variable, and that {{Ic|$JAVA_HOME}} points to the correct position (generally {{Ic|/opt/java}}). You can do this by either logging out and in again, or by sourcing {{Ic|/etc/profile}}.}}<br />
<br />
=== Apache Harmony ===<br />
[http://harmony.apache.org/ Apache Harmony] is a clean room re-implementation of the Java language and comes under the Free Apache license. A binary re-distribution of the Harmony JRE can be found in the AUR: {{AUR|apache-harmony-jre}}.<br />
<br />
=== Kaffe ===<br />
[http://www.kaffe.org/ Kaffe] is another clean-room implementation of a Java VM without official endorsement from Sun/Oracle. A [[git]] package of Kaffe can be found in the [[AUR]] here: {{AUR|kaffe-git}}. The Kaffe VM is redistributed according to the GPL license.<br />
<br />
=== BEA JRockit JIT JVM (+JDK) ===<br />
[[Wikipedia:JRockit|JRockit]] is JIT version of Java, provided by Oracle and available from the AUR here: {{AUR|jrockit}}.<br />
<br />
=== VMkit LLVM-based JIT VM ===<br />
[http://vmkit.llvm.org/index.html VMkit] is an LLVM-based framework for JIT virtual machines. J3 is a JVM running on VMkit. A broken build for VMkit can be found in the [[AUR]] here: {{AUR|vmkit-svn}}. J3 depends on the GNU classpath libraries, but may also work with the Apache class path libraries.<br />
<br />
=== Parrot VM ===<br />
The [http://www.archlinux.org/packages/?q=parrot Parrot VM] offers experimental [http://trac.parrot.org/parrot/wiki/Languages support for Java] through two different methods: Either as a [http://code.google.com/p/parrot-jvm/ Java VM bytecode translator] or as a [https://github.com/chrisdolan/perk Java compiler targeting the Parrot VM]. Available in the AUR package {{AUR|parrot-git}}.<br />
<br />
== Troubleshooting ==<br />
=== MySQL ===<br />
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#Enable remote access|MySQL article]].<br />
<br />
=== Java sound with Pulseaudio ===<br />
{{Note|This procedure is likely to be relevant for previous version of Java (Java 6) only.}}<br />
<br />
By default, Java and [[Pulseaudio]] do not get along very well with each other, but this is easy to fix using padsp.<br />
<br />
(These paths are correct for Sun's Java, you will need to change the paths for OpenJDK)<br />
<br />
First, rename the {{Ic|java}} binary to {{Ic|java.bin}}<br />
# mv /opt/java/jre/bin/java /opt/java/jre/bin/java.bin<br />
Then, create a new launcher script at {{Ic|/opt/java/jre/bin/java}}<br />
#!/bin/sh<br />
padsp /opt/java/jre/bin/java.bin "$@"<br />
Finally, make the launcher script executable<br />
# chmod +x /opt/java/jre/bin/java<br />
You will need to redo this process on each update of Java.<br />
<br />
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.<br />
<br />
== Tips and tricks ==<br />
{{Note|Suggestions in this section are applicable to all applications, using explicitly installed (external) Java runtime. Some applications are bundled with own (private) runtime or use own mechanics for GUI, font rendering etc, so none of written below is guaranteed to work.}}<br />
<br />
Behavior of most Java applications can be controlled by supplying predefined variables to Java runtime. From [https://bbs.archlinux.org/viewtopic.php?id=72892 this forum post], a way to do it consists of adding the following line in your {{Ic|~/.bashrc}} (or {{Ic|/etc/profile.d/jre.sh}} to affect all users):<br />
<br />
export _JAVA_OPTIONS="-D'''<option 1>''' -D'''<option 2>'''..."<br />
<br />
=== Better font rendering ===<br />
Both closed source and open source one implementations of Java are known to have improperly implement antialiasing of fonts. This can be fixed with following options: {{Ic|1=awt.useSystemAAFontSettings=on}}, {{Ic|1=swing.aatext=true}}<br />
<br />
=== GTK LookAndFeel ===<br />
If your java programs look ugly, you may want to set up the default look and feel for the swing components: {{Ic|1=swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel}}.</div>Teh5abikinghttps://wiki.archlinux.org/index.php?title=Java&diff=193720Java2012-04-10T19:27:07Z<p>Teh5abiking: /* Oracle JVM */</p>
<hr />
<div>[[Category:Development (English)]]<br />
{{i18n|Java}}<br />
[[fr:Java]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|This article explains how to install and configure JRE/JDK.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Java Package Guidelines}}<br />
{{Article summary end}}<br />
<br />
"''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.''" &mdash; [[Wikipedia:Java (programming language)|Wikipedia article]]<br />
<br />
== Installation ==<br />
The only JVM implementation in supported repositories is the open source [http://openjdk.java.net/ OpenJDK]. Additional Java implementations are available via the [[AUR]]. Keep in mind that the open-source and closed-source versions cannot be installed simultaneously. The open-source version is nearly perfect at the time of writing, and there is mostly no need anymore to install Oracle's proprietary version of Java.<br />
<br />
=== OpenJDK JVM ===<br />
To be able to run Java programs, you can install [[Wikipedia:JRE|Java runtime]] with the package {{Pkg|jre7-openjdk}}, available in the [[official repositories]]. There is also a [[Wikipedia:JDK|Java Development Kit]] in {{Pkg|jdk7-openjdk}}. For those interested in the old Java v6, both JRE6 and JDK6 can be found in {{Pkg|openjdk6}}.<br />
<br />
You will likely need the {{Pkg|icedtea-web-java7}} package for Java functionality in browsers, namely [[Wikipedia:Java applet|applets]] and [[Wikipedia:Java Web Start|Web Start]] (for more details see [[Browser Plugins#Java]]).<br />
<br />
{{Note|If you use a non-reparenting window manager and Java 6, you should uncomment the corresponding line in {{Ic|/etc/profile.d/openjdk6.sh}}}}<br />
<br />
=== Oracle JVM ===<br />
Prior to the [http://mailman.archlinux.org/pipermail/arch-general/2011-August/021671.html retirement of the Oracle DLJ], it was possible to simply install the {{Ic|jre}} and {{Ic|jdk}} packages from the repositories. However, now Arch Linux (and any other GNU/Linux distribution) can no longer package the Oracle implementation of Java. The OpenJDK packages are the recommended providers of {{Ic|java-runtime}} and {{Ic|java-environment}}.<br />
<br />
AUR contains packages for {{AUR|jre}} and {{AUR|jdk}}, the Oracle implementations of Java.<br />
<br />
{{Note|You will need to ensure that {{Ic|/opt/java/jre/bin/}} is in your {{Ic|$PATH}} variable, and that {{Ic|$JAVA_HOME}} points to the correct position (generally {{Ic|/opt/java}}). You can do this by either logging out and in again, or by sourcing {{Ic|/etc/profile}}.}}<br />
<br />
=== Java SE 6 (Oracle JVM) ===<br />
<br />
For users interested in Java SE 6, the packages {{AUR|jre}} and {{AUR|jdk}} have been updated to Java SE 7. However, you can still install the JRE/JDK manually. <br />
<br />
Here's how to do so:<br />
<br />
{{Note| This short walkthrough installs the JDK alone.}}<br />
<br />
First, go to http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html, move down to Hava SE 6u31 (or something of the sort) "JDK." Accept the license agreement and then download either {{Ic|jdk-6u31-linux-i586.bin}} if your system is 32-bit OR {{Ic|jdk-6u31-linux-i586.bin}} if your system is 64-bit. <br />
<br />
Now, do the following:<br />
<br />
{{Note| The rest of this walkthrough assumes you'll be installing the JDK in /opt. If this is not the case, alter the instructions to where you installed the JDK. Instructions for 32-bit and 64-bit operating systems will vary.}}<br />
<br />
==== For 32-bit systems ====<br />
<br />
Open up a terminal, and then change to the directory where you downloaded the binary. Then do the following: <br />
<br />
$ chmod a+x jdk-6u31-linux-i586.bin<br />
$ su -c 'mv jdk-6u31-linux-i586.bin /opt<br />
$ cd /opt<br />
# ./jdk-6u31-linux-i586.bin <br />
# rm jdk-6u31-linux-i586.bin<br />
<br />
The JDK has now been installed. However, we're not quite finished. We need to alter our PATH so that Java will be in it. To do so, we need to edit /etc/profile. Why? Because we want to make this configuration system-wide, and not bound to one user. Now, using your favorite text editor, open up /etc/profile as root and then find this line:<br />
<br />
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:"<br />
<br />
Now, add the location of where the JDK was installed. In this tutorial's case, the JDK was installed in /opt. Therefore, the result should look like this if you've installed the JDK in /opt: <br />
<br />
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/jdk1.6.0_31/bin:/opt/jdk1.6.0_31/jre/bin"<br />
<br />
After you've done so, save your changes and exit. For your changes to take effect, either log out or source /etc/profile. To see if the changes took place, execute the following: <br />
<br />
$ echo $PATH<br />
<br />
If you see something like <jdk>/bin:<jdk>/jre/bin in your PATH, where <jdk> is the location of where you installed it, congratulations! You've installed the JDK!<br />
<br />
To install the browser plugin, first close any and all web browser you have open. Then create a symlink to the browser plugin like so: <br />
<br />
$ ln -s <jdk>/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins<br />
<br />
Remember to replace <jdk> with the location of where the JDK is.<br />
<br />
==== For 64-bit systems ====<br />
<br />
According to Oracle, you can run either the 32-bit version of the JDK/JRE or the 64-bit, however if you have a 32-bit browser, you *must* follow the 32-bit version of the tutorial. The installation of the JDK/JRE remains largely the same, aside from a few differences.<br />
<br />
First, open up a terminal and then change to the directory where you downloaded the binary. Then, do the following: <br />
<br />
{{Note| If you're not going to install in /opt, then change the instructions to where you wish to install the JDK.}}<br />
<br />
$ chmod a+x jdk-6u31-linux-x64.bin<br />
$ su -c 'mv jdk-6u31-linux-x64.bin /opt'<br />
$ cd /opt<br />
# ./jdk-6u31-linux-x64.bin<br />
# rm jdk-6u31-linux-x64.bin<br />
<br />
Now that the JDK's been installed, it's time to edit your PATH. Using your favorite text editor, open up /etc/profile as root and then find the line in /etc/profile that looks like this: <br />
<br />
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:"<br />
<br />
Now append the location to where you set up the JDK to the end of the line. In this tutorial's case, it was installed in /opt. Therefore, the result for us will look like this: <br />
<br />
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/jdk1.6.0_31/bin:/opt/jdk1.6.0_31/jre/bin"<br />
<br />
Now either log out or source /etc/profile. To see if your changes took effect, execute the following: <br />
<br />
$ echo $PATH<br />
<br />
If you see something like <jdk>/bin:<jdk>/jre/bin in your PATH, where <jdk> is the location of where you installed the JDK, congratulations! You just installed the JDK manually :). Give yourself a pat on the back.<br />
<br />
To install the browser plugin, close all browser windows you have open and create a symlink to {{Ic|~/.mozilla/plugins.}} like so: <br />
<br />
$ ln -s <jdk>/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins<br />
<br />
=== Apache Harmony ===<br />
[http://harmony.apache.org/ Apache Harmony] is a clean room re-implementation of the Java language and comes under the Free Apache license. A binary re-distribution of the Harmony JRE can be found in the AUR: {{AUR|apache-harmony-jre}}.<br />
<br />
=== Kaffe ===<br />
[http://www.kaffe.org/ Kaffe] is another clean-room implementation of a Java VM without official endorsement from Sun/Oracle. A [[git]] package of Kaffe can be found in the [[AUR]] here: {{AUR|kaffe-git}}. The Kaffe VM is redistributed according to the GPL license.<br />
<br />
=== BEA JRockit JIT JVM (+JDK) ===<br />
[[Wikipedia:JRockit|JRockit]] is JIT version of Java, provided by Oracle and available from the AUR here: {{AUR|jrockit}}.<br />
<br />
=== VMkit LLVM-based JIT VM ===<br />
[http://vmkit.llvm.org/index.html VMkit] is an LLVM-based framework for JIT virtual machines. J3 is a JVM running on VMkit. A broken build for VMkit can be found in the [[AUR]] here: {{AUR|vmkit-svn}}. J3 depends on the GNU classpath libraries, but may also work with the Apache class path libraries.<br />
<br />
=== Parrot VM ===<br />
The [http://www.archlinux.org/packages/?q=parrot Parrot VM] offers experimental [http://trac.parrot.org/parrot/wiki/Languages support for Java] through two different methods: Either as a [http://code.google.com/p/parrot-jvm/ Java VM bytecode translator] or as a [https://github.com/chrisdolan/perk Java compiler targeting the Parrot VM]. Available in the AUR package {{AUR|parrot-git}}.<br />
<br />
== Troubleshooting ==<br />
=== MySQL ===<br />
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#Enable remote access|MySQL article]].<br />
<br />
=== Java sound with Pulseaudio ===<br />
{{Note|This procedure is likely to be relevant for previous version of Java (Java 6) only.}}<br />
<br />
By default, Java and [[Pulseaudio]] do not get along very well with each other, but this is easy to fix using padsp.<br />
<br />
(These paths are correct for Sun's Java, you will need to change the paths for OpenJDK)<br />
<br />
First, rename the {{Ic|java}} binary to {{Ic|java.bin}}<br />
# mv /opt/java/jre/bin/java /opt/java/jre/bin/java.bin<br />
Then, create a new launcher script at {{Ic|/opt/java/jre/bin/java}}<br />
#!/bin/sh<br />
padsp /opt/java/jre/bin/java.bin "$@"<br />
Finally, make the launcher script executable<br />
# chmod +x /opt/java/jre/bin/java<br />
You will need to redo this process on each update of Java.<br />
<br />
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.<br />
<br />
== Tips and tricks ==<br />
{{Note|Suggestions in this section are applicable to all applications, using explicitly installed (external) Java runtime. Some applications are bundled with own (private) runtime or use own mechanics for GUI, font rendering etc, so none of written below is guaranteed to work.}}<br />
<br />
Behavior of most Java applications can be controlled by supplying predefined variables to Java runtime. From [https://bbs.archlinux.org/viewtopic.php?id=72892 this forum post], a way to do it consists of adding the following line in your {{Ic|~/.bashrc}} (or {{Ic|/etc/profile.d/jre.sh}} to affect all users):<br />
<br />
export _JAVA_OPTIONS="-D'''<option 1>''' -D'''<option 2>'''..."<br />
<br />
=== Better font rendering ===<br />
Both closed source and open source one implementations of Java are known to have improperly implement antialiasing of fonts. This can be fixed with following options: {{Ic|1=awt.useSystemAAFontSettings=on}}, {{Ic|1=swing.aatext=true}}<br />
<br />
=== GTK LookAndFeel ===<br />
If your java programs look ugly, you may want to set up the default look and feel for the swing components: {{Ic|1=swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel}}.</div>Teh5abiking