Was:

Anleitung, um TaxMe 2006 unter amd64 unter Linux, Ubuntu Jaunty 9.04 zum Laufen zu bringen.

Kurzversion:

   $ cd ~/TaxMeBe2006/lib/ && mv linux-gtk linux-gtk.32bit && mkdir linux-gtk && cd linux-gtk
   $ sudo apt-get install libswt3.2-gtk-jni libjna-java
   $ for i in atk awt cairo gnome "" mozilla pi ; do ln -s /usr/lib/jni/libswt-${i}-gtk-3236.so; done
   $ ln -s /usr/lib/java/swt.jar

Herleitung:

Wenn man TaxMe 2006 auf einer amd64 Platform startet, dann passiert nichts.

in TaxMeBe2006/log.txt steht dann:

   $ cat TaxMeBe2006/log.txt
   java.lang.reflect.InvocationTargetException
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:616)
           at ch.dvbern.lib.update.Launcher.main(Launcher.java:91)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:616)
           at com.zerog.lax.LAX.launch(DashoA8113)
           at com.zerog.lax.LAX.main(DashoA8113)
   Caused by: java.lang.UnsatisfiedLinkError: /home/user/TaxMeBe2006/lib/linux-gtk/libswt-pi-gtk-3235.so: /home/user/2006/TaxMeBe2006/lib/linux-gtk/libswt-pi-gtk-3235.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
           at java.lang.ClassLoader$NativeLibrary.load(Native Method)
           at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1767)
           at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1692)
           at java.lang.Runtime.loadLibrary0(Runtime.java:840)
           at java.lang.System.loadLibrary(System.java:1047)
           at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
           at org.eclipse.swt.internal.gtk.OS.(OS.java:22)
           at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
           at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
           at org.eclipse.swt.widgets.Display.(Display.java:126)
           at ch.dvbern.tax.common.presentation.cd.util.GuiUtil.getImageRegistry(GuiUtil.java:134)
           at ch.dvbern.tax.common.presentation.cd.action.ActionBase.(ActionBase.java:59)
           at ch.dvbern.tax.common.presentation.cd.action.menu.FilePrintAction.(FilePrintAction.java:26)
           at ch.dvbern.tax.be.presentation.cd.TaxmeBeLauncher.main(TaxmeBeLauncher.java:54)
           ... 11 more

Aha - wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch) - weisst darauf hin, dass wir irgendwo ein 32bit executable (bzw. hier eine 32bit Bibliothek haben), wo das System 64bit bräuchte.

Wir müssen also libswt-pi-gtk-3235.so durch eine 64bit Version ersetzen. Wir schauen zuerst Mal im Verzeichnis /home/user/TaxMeBe2006/lib/linux-gtk/ nach und sehen, dass es da noch einen Haufen andere Bibliotheken hat. Die sollten also allesammt ersetzt werden. Machen wir also, aber zuerst legen wir Mal die existierenden Dateien auf die Seite:

   $ cd ~/TaxMeBe2006/lib/ && mv linux-gtk linux-gtk.32bit && mkdir linux-gtk

So, nun ist das original linux-gtk Verzeichnis auf der Seite und wir haben ein frisches, leeres linux-gtk zum Basteln.

Wo kriegt man nun die entsprechenden libswt-pi-gtk-3235.so 64bit Bibliotheken her? Da mein Rechner unter Ubuntu läuft suche ich dort ein bischen in den Paketen herum - http://packages.ubuntu.com bietet das entsprechende Suchinterface und man findet heraus, dass einerseits nur die Version -3236 der Bibliotheken vorliegt, und dass andererseits diese im Ubuntu Paket libswt3.2-gtk-jni zu finden sind. swt.jar wiederum befindet sich im Paket libswt3.2-gtk-java. Also

   $ sudo apt-get install libswt3.2-gtk-jni libjna-java

Nur leider genügt die Installation der Pakete nicht, da TaxMe2006, obwohl ein unter Linux funktionsfähiges Programm in seiner eigenen Welt läuft. Vielleicht müsste, um dem abzuhelfen der richtige Pfad oder die richtige Umgebungsvariable gesetzt werden - hab nicht lange gesucht, und die entsprechenden Bibliotheken einfach verlinkt:

$ ls -l TaxMeBe2006/lib/linux-gtk/ lrwxrwxrwx … libswt-atk-gtk-3236.so -> /usr/lib/jni/libswt-atk-gtk-3236.so lrwxrwxrwx … libswt-awt-gtk-3236.so -> /usr/lib/jni/libswt-awt-gtk-3236.so lrwxrwxrwx … libswt-cairo-gtk-3236.so -> /usr/lib/jni/libswt-cairo-gtk-3236.so lrwxrwxrwx … libswt-gnome-gtk-3236.so -> /usr/lib/jni/libswt-gnome-gtk-3236.so lrwxrwxrwx … libswt-gtk-3236.so -> /usr/lib/jni/libswt-gtk-3236.so lrwxrwxrwx … libswt-mozilla-gtk-3236.so -> /usr/lib/jni/libswt-mozilla-gtk-3236.so lrwxrwxrwx … libswt-pi-gtk-3236.so -> /usr/lib/jni/libswt-pi-gtk-3236.so lrwxrwxrwx … swt.jar -> /usr/lib/java/swt.jar

Und siehe da - es klappt, TaxMe2006 startet.

Tomáš Pospíšek