ubuntu 64位系统,开启ddms后,swt报错

$ ./ddms 
16:23 D/ddms: Initializing
16:23 E/ddms: shutting down due to uncaught exception
16:23 E/ddms: java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-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.widgets.Display.createDisplay(Unknown Source)
	at org.eclipse.swt.widgets.Display.create(Unknown Source)
	at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
	at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
	at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
	at com.android.ddms.UIThread.runUI(UIThread.java:330)
	at com.android.ddms.Main.main(Main.java:97)

首先,设置好64位swt.jar目录,可以从网上下载,或者sdk中的tools/lib/x86_64目录,或者编译后源代码的prebuilt/linux-x86_64/swt目录

(可选)然后修改ddms等等scripts,
例如 androidSDK/tools/android, change the last line from:
exec "$java_cmd" -Xmx256M $os_opts $java_debug -Djava.ext.dirs="$frameworkdir" -Dcom.android.sdkmanager.toolsdir="$progdir" -jar "$jarpath" "$@"

to:
exec "$java_cmd" -d32 -Xmx256M $os_opts $java_debug -Djava.ext.dirs="$frameworkdir" -Dcom.android.sdkmanager.toolsdir="$progdir" -jar "$jarpath" "$@"

你可能感兴趣的:(ubuntu)