Skip to main content

Running CDC / LWUIT application with phoneME Advanced?

12 replies [Last post]
t56
Offline
Joined: 2009-03-11
Points: 0

Hi all,
I'm trying to run a CDC application using LWUIT on phomeME Advanced VM but I'm getting the error below. I use the personal profile (downloaded from http://www.cs.kuleuven.be/~davy/phoneme/index.php?q=node/10) and the JDBC optional package.

The application runs in Netbeans, but when I copy it to my Windows Mobile 5 Emulator it gives the error:
------------------------
java.lang.UnsupportedClassVersionError: com/sun/lwuit/util/Resources (Unsupported major.minor version 50.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.getMethod0(Native Method)
at java.lang.Class.getMethod(Unknown Source)
at sun.misc.CVM.runMain(Unknown Source)
----------------

The command I use to run it is

255#"\Storage Card\bin\cvm.exe" "-Xopt:stdioPrefix=\Storage Card" "-Xbootclasspath/a:\Storage Card\jdbc.jar" -cp "\Storage Card\microbackend.jar;\Storage Card\lwuimb-0.1-alpha1.jar;\Storage Card\derby.jar;\Storage Card\MyApp.jar" myapp.MyApp

As you can see, I use the jars

jdbc.jar
derby.jar
microbackend.jar
lwuimb-0.1-alpha1.jar

The jdbc.jar was built using j2sdk1.4.2_19. I don't have Linux so I can't rebuild the LWUIT port jars myself.

I had the application running using AWT on the emulator but want to switch to LWUIT. I downloaded the LWUIT port from http://lwuimb.thenesis.org/bin/view/Main/FAQ.

Any ideas would be much appreciated. Is there perhaps another LWUIT port jar I could try?
Many thanks, John.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aqtoor
Offline
Joined: 2004-10-16
Points: 0

I have been unable to run Theme resource files created by LWUIT designer. Also the res files included in demos in Java TV SDK do not open up in LWUIT designer. Are they created from a different tool?

Regards
Atif

tamir
Offline
Joined: 2006-08-29
Points: 0
tamir
Offline
Joined: 2006-08-29
Points: 0

Hi,

Please let me give you our version of LWUIT port for CDC - hope that will help you.

Please download our SDK from: https://javatv-developers.dev.java.net/servlets/ProjectProcess?tab=1

After installing it, go to the /emulator/lib and look for CDCPort.jar
That is the LWUIT port for CDC - ported on top of PBP (will work on PP as well - although we didn't test it on your PP version).

Regards,
Tamir
https://javatv-developers.dev.java.net

t56
Offline
Joined: 2009-03-11
Points: 0

Thanks for that Tamir. I tried that with a simple example, but now get the runtime error:

Exception in thread "main" java.lang.ClassCastException: helloworld.HelloWorld cannot be cast to com.sun.lwuit.Context
at com.sun.lwuit.Implementation.init(Implementation.java:77)
at com.sun.lwuit.Display.init(Display.java:217)
at helloworld.HelloWorld.(HelloWorld.java:30)
at helloworld.HelloWorld.main(HelloWorld.java:26)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

I can't seem to find out what com.sun.lwuit.Context is. Here's the little example I was using to test this:

--------------------------------------------------
import com.sun.lwuit.*;
import com.sun.lwuit.layouts.*;

public class HelloWorld extends Object {

private Form f;

public HelloWorld() {
super();
}

public void init() {
Display.init(this);

f = new Form();
f.setTitle("Hello World");

f.setLayout(new BorderLayout());
f.addComponent("Center", new Label("Hello Label"));

}

public void start() {
f.show();
}

public void stop() {
}

public void dispose() {
}

public static void main(String[] args) {
HelloWorld test = new HelloWorld();
test.init();
test.start();
}
}
--------------------------------------------------

Does anyone have any ideas?
At least I'm not getting
java.lang.UnsupportedClassVersionError: com/sun/lwuit/util/Resources (Unsupported major.minor version 50.0) anymore.
Cheers, John.

t56
Offline
Joined: 2009-03-11
Points: 0

Happy days. It works! My last post was a bit dumb. If I extend Context it all works fine. Thanks again Tamir.

tamir
Offline
Joined: 2006-08-29
Points: 0

HI John,

Regarding Context, all you need to do is use it like:
Display.init(new Context());

Context helps to define your screen bounds and key code of right and left soft keys
e.g. new Context(0,0, 1920, 1080, 55, 57) // for a FullHD screen
the first 4 parameters are the screen bounds
the last two are the soft keys.

Regards,
Tamir
https://javatv-developers.dev.java.net

t56
Offline
Joined: 2009-03-11
Points: 0

Cheers. Thanks for all your help Tamir.

arnold123
Offline
Joined: 2009-07-16
Points: 0

Spam deleted

Message was edited by: akelly

tamir
Offline
Joined: 2006-08-29
Points: 0

com.sun.lwuit.Context is an object that helps you determine the bounds of the screen and the right and left soft keys (like in Mobile). Can use to handle the TV display safe area, for example.

The options to use are (also on our community code samples - https://javatv-developers.dev.java.net/servlets/ProjectDocumentList)

Context() // get all screen area
Or
Context(int x, int y, int width, int height, int leftSoft, int rightSoft) // define the bounds of the screen and the right and left soft keys

And you can call it here:
Display.init(new Context());

Regards,
Tamir
https://javatv-developers.dev.java.net/

aqtoor
Offline
Joined: 2004-10-16
Points: 0

I have downloaded the JavaDTV LWUIT SDK but could find the cdcport.jar and also the LWUIT implentation under com.sun.dtv.lwuit do not have a Context class. Where can I find the cdc port you mentioned earlier.

Regards
Atif

tamir
Offline
Joined: 2006-08-29
Points: 0

Hi Atif,

The CDCPort is in the Win32 SDK: https://javatv-developers.dev.java.net/servlets/ProjectProcess?documentC...
Same place: after installing emulator/lib/cdcport.jar

The SDK you download is supporting LWUIT in DTV API (for Ginga-J - Brazil)

Regards,
Tamir
https://javatv-developers.dev.java.net

aqtoor
Offline
Joined: 2004-10-16
Points: 0

Thanks for help.

Regards
Atif