--- a/jdic/src/unix/native/jni/Tray.c	2010-01-09 10:31:24.000000000 +0000
+++ b/jdic/src/unix/native/jni/Tray.c	2010-01-09 10:34:50.000000000 +0000
@@ -74,7 +74,31 @@
 static void *awtHandle = NULL;
 
 #ifdef __linux__
-#define LIBARCH  "i386"
+#  if defined(__x86_64__)
+#    define LIBARCH "amd64"
+#  elif defined(__i386__)
+#    define LIBARCH "i386"
+#  elif defined(__alpha__)
+#    define LIBARCH "alpha"
+#  elif defined(__ia64__)
+#    define LIBARCH "ia64"
+#  elif defined(__arm__)
+#    define LIBARCH "arm"
+#  elif defined(__mips__)
+#    define LIBARCH "mips"
+#  elif defined(__MIPSEL__)
+#    define LIBARCH "mipsel"
+#  elif defined(__powerpc__)
+#    define LIBARCH "ppc"
+#  elif defined(__sparc__)
+#    define LIBARCH "sparc"
+#  elif defined(__s390__)
+#    define LIBARCH "s390"
+#  elif defined(__sh__)
+#    define LIBARCH "sh"
+#  else
+#    error "Unknown arch, please edit "__FILE__
+#  endif
 #else
 #ifdef __i386
 #define LIBARCH "i386"
@@ -717,7 +741,7 @@
     awtHandle = dlopen(awtPath, RTLD_LAZY);
     if (awtHandle == NULL) {
         /* must be JDK try JDK location */
-        sprintf(awtPath,"%s/jre/lib/%s/libawt.so",java_home, LIBARCH);
+        sprintf(awtPath,"%s/lib/%s/libawt.so",java_home, LIBARCH);
         dprintf("JDK - %s\n",awtPath);
         awtHandle = dlopen(awtPath, RTLD_LAZY);
 
