利用raspberrypi安裝EINVTurnkey會遇到的問題排除

在Raspberry pi 安裝Linux版的 EINVTurnkey電子發票整合服務平台時會遇幾個問題

*不支援64bit SWT library

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
	at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
	at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
	at com.tradevan.gateway.client.view.EnvironmentSetting.main(EnvironmentSetting.java:125)

這部份基本上沒解決,所以改跑 32元位版本來解決這個問題

*在32bit時找不到SWT library位置

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	no swt-gtk-3738 in java.library.path
	no swt-gtk in java.library.path
	/home/pi/.swt/lib/linux/arm/libswt-gtk-3738.so: /home/pi/.swt/lib/linux/arm/libswt-gtk-3738.so: 無法開啟共用目的檔: 沒有此一檔案或目錄 (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
	Can't load library: /home/pi/.swt/lib/linux/arm/libswt-gtk.so

	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
	at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
	at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
	at com.tradevan.gateway.client.view.EnvironmentSetting.main(EnvironmentSetting.java:125)

這裡找到一個解決方法SWT libraries

就是安裝SWT-GTK來解決這個問題

sudo apt-get install libswt-gtk-4-java libswt-cairo-gtk-4-jni -y

然後copy "/usr/lib/java/swt-gtk-<version>.jar"到turnkey的/lib目錄,並把它取代swt-linux-3.7.1-32bit.jar

rm ~/linux/lib/swt-linux-3.7.1-32bit.jar
cp /usr/lib/java/swt-gtk-4.6.0.jar ~/linux/lib/swt-linux-3.7.1-32bit.jar

*第一次執行時用runFirst32.sct來設定環境

*執行環境用einvTurnkey32.sct

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料