Wierd problem with AWT runtime library

Hi everyone!

I created a BasicGame project with the jMonkeyEngine SDK 3.0 wizard and made it deployable to a Nexus 7 device (as described at https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:android).

It worked fine on the device, but when I added ‘import java.awt.Point;’ to the Main.java code, along with a simple Point definition to the simpleInitApp() override (like: ‘Point point = new Point();’) I got the following runtime error on the device:

E/com.jme3.app.AndroidHarness( 7069): SEVERE Exception thrown in Thread[GLThread 315,5,main]
E/com.jme3.app.AndroidHarness( 7069): java.lang.NoClassDefFoundError: java.awt.Point
E/com.jme3.app.AndroidHarness( 7069): at mygame.Main.simpleInitApp(Main.java:32)
E/com.jme3.app.AndroidHarness( 7069): at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
E/com.jme3.app.AndroidHarness( 7069): at com.jme3.app.AndroidHarness.initialize(AndroidHarness.java:455)
E/com.jme3.app.AndroidHarness( 7069): at com.jme3.system.android.OGLESContext.initInThread(OGLESContext.java:229)
E/com.jme3.app.AndroidHarness( 7069): at com.jme3.system.android.OGLESContext.onSurfaceCreated(OGLESContext.java:205)
E/com.jme3.app.AndroidHarness( 7069): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1501)
E/com.jme3.app.AndroidHarness( 7069): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

The project runs fine on the desktop. It only fails runtime on the device.

I thought it was due to awt not being supported on Android or something, but then noticed that one of the demos in the JME3TestsAndroid project(TestChangeAppIcon.java) does actually use it and runs fine on the Nexus 7.

Additional info: when I right-click the Main.java (in the jMonkeyEngine SDK editor for my BasicGame project) and select Properties, I can get the following list of Runtime Class libraries:

C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-core.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-desktop.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-plugins.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-effects.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-networking.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-jogg.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\j-ogg-oggd.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\j-ogg-vorbisd.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-terrain.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-lwjgl.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-lwjgl-natives.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jinput.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-jbullet.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jbullet.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\vecmath.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\stack-alloc.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\jME3-niftygui.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\nifty.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\nifty-default-controls.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\nifty-style-black.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\eventbus.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\xmlpull-xpp3.jar;C:\Program Files\jmonkeyplatform\jmonkeyplatform\libs\lwjgl.jar;C:\WIN8\Android\projects\DeleteMe\build\classes;C:\WIN8\Android\projects\DeleteMe\assets

I googled around for the NoClassDefFoundError and searched the forum, but got even more confused :confused:

Note I’m very new to jMonkeyEngine and Android development, so… sorry if it’s a stupid question!

-Dave

AWT isn’t supported on android, the jME3-Desktop library isn’t either. Thats why its called “desktop”.

Blazing fast reply, thanx! At least for a while I dreamed I could enjoy all those nice awt functions on Android as well :slight_smile: