The JDK 8 build fails on Ubuntu 11.10 with gcc 4.6 when linking the
Java sound native library against libasound2, the ALSA shared library.
It appears that in this instance gcc only tries to resolve undefined
symbols against a library if the library is named on the command line
after the object files containing those symbols. This behavior is in
accordance with the GNU ld specification . On earlier versions of
Ubuntu, however, this link step worked even though the asound library
was named on the gcc command line ahead of the object files that refer
The fix is simply to move -lasound to the end of the gcc invocation.
This may or may not be related to the conversion of libasound2 to the
multiarch format in Ubuntu 11.10 .