I've got a Linux box with both a 32-bit and a 64-bit JRE installed. The code
InetAddress host = InetAddress.getLocalHost();
run fine when I use the 32-bit JRE but throws a UnknownHostException when run against the 64-bit JRE. Everything else seems to run fine in the 64-bit Java; this is the only code we've found that is failing. I suspect I am missing a 64-bit library but I would think that would lead to a different error. I've run strace against both cases and the libraries loaded are identical, other than one loads the 32-bit libraries and the other loads the 64-bit libraries. Something is missing though on my system that causes Java to throw an exception when running with the 64-bit JRE. Does anyone have any suggestions what might causes this behavior?
I seem to remember that call (or a similar one) failing on Linux if I did not have an explicit entry for "localhost" in /etc/hosts. This is a bit of a stretch, but it might be that the 64-bit version is looking for an ipv6 version of "localhost". I think I've seen something auto-generated for new Linux installs along the lines of "localhostv6" or something like that. If you can find an example of that somewhere, try adding that to your /etc/hosts file.
I had meant to mention that I do in fact have have /etc/hosts setup correctly with entries for both localhost as well as for the host itself. The Linux box I'm running on doesn't have IPv6 enabled so there is no entry for that. Besides, the 32 bit version works fine. There is something incomplete as far as the 64 bit version is concerned.