NoClassDefFoundError When Using Toolkit or Display

I am developing for mobile devices and I am trying to get the screen size. I have tried java.awt.Toolkit.Toolkit.getDefaultToolkit().getScreenSize() and I have also tried org.lwjgl.opengl.Display.getWidth(). Every time I use either Toolkit or Display I get a NoClassDefFoundError for Toolkit and for Display. Toolkit is in the Java SDK and Display is in the lwjgl library. Both are automatically included in a new project so I can’t for the life of me figure out why I keep getting the error.

I have tried creating a new hello world game, I restarted JME and restarted my computer, did a clean and build. I can’t seem to get around this error. I did do an update of the nightly build today(4/29/2014) and after that I have been getting this problem.

Note: I have now also uninstalled JME3 and re-installed it and I still get the same error.

Well, AWT doesn’t exist on Android. I don’t know that lwjgl is used on Android either… not sure there.

Why not just use the normal JME way of getting the screen dimensions?

I’d love to. What is the JME3 way?

@jcrosby10 said: I'd love to. What is the JME3 way?

You could use:

// or from someplace other than simple application:

Syntax may be a little off as this was from memory.