DDMS on Ubuntu throws exception ?

I downloaded the latest Android SDK and connected my Nexus One. Once starting DDMS, it throws up this
[codesyntax lang=”xml” title=”DDMS error”]
user@wanaka-ubuntu:~/android-sdk-linux_x86/tools$ ./ddms

(ddms:10868): Gdk-WARNING **: gdk_window_set_icon_list: icons too large
04:37:36 E/ddms: shutting down due to uncaught exception
04:37:36 E/ddms: java.lang.UnsatisfiedLinkError: Can’t load library: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/xawt/libmawt.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1649)
at java.lang.Runtime.load0(Runtime.java:787)
at java.lang.System.load(System.java:1022)

[/codesyntax]

If you read the log, you realize it tries to use the openjdk version, but we want to use the SUN (ahem Oracle) JRE.

Open the ddms script file and change the line (around line no.65)

javaCmd=”java”

to

javaCmd=”/usr/lib/jvm/java-6-sun-1.6.0.22/bin/java” (adapt it to your proper path to the java binary!)

There we go ! Lets snoop inside the phone

Dalvik Debug Monitor (DDMS)

and we can even create screenshots !

Android Screenshot

Advertisements

One thought on “DDMS on Ubuntu throws exception ?

  1. Or, if you’ve installed JDK in order to develop Andoid applications, you must tell DDMS to EXPLICITLY use your JDK installation. In my case ‘~/java’:

    javaCmd=’~/java/bin/java’

    because libmawt.so is found under ‘~/java/jre/lib/amd64/xawt’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s