Jython for J2ME?

View: New views
2 Messages — Rating Filter:   Alert me  

Jython for J2ME?

by id804097 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi: I am trying to compile a simple j2me program.
 
from javax.microedition.midlet import *
class MyFirstMidlet(MIDlet):
    def __init__(self):
        print "hello world"
        self.destroyApp(False)
   
    def startApp(self): pass
    def pauseApp(self): pass
    def destroyApp(self,unconditional):pass
 
with the compile command:
 
jythonc -i --core -b MyFirstMidlet.jar --jar C:\WTK2.5.2\lib\midpapi20.jar --jar C:\WTK2.5.2\lib\cldcapi11.jar -C "C:\Program Files\Java\jdk1.5.0_03\bin\javac.exe" MyFirstMidlet.py
 
It produces two class files - MyFirstMidlet$_PyInner.class & MyFirstMidlet.class
 
Once compiled, I need to preverify for j2me (I'm referencing http://today.java.net/pub/a/today/2005/02/09/j2me1.html?page=2). When I do that I get an error - java/lang/NoClassDefFoundError: java/lang/Object
 
Preverify command is: C:\WTK2.5.2\bin\preverify.exe -classpath  C:\WTK2.5.2\lib\midpapi20.jar;C:\WTK2.5.2\lib\cldcapi11.jar MyFirstMidlet
 
then I tried to compile the .java generated by jython. It throws errors - cannot find symbol.
 
BTW: It is - Jython 2.2.1 on java1.5.0_03
 
Can anyone help me plese? Thank you in advance,
Joseph

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: Jython for J2ME?

by astigmatik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jythonc hasn't been supported for quite some time (I think just before
Jython2.2.1). Check out
http://wiki.python.org/jython/JythonFaq/DistributingJythonScripts for
the complicated process of creating a jar.

On Wed, Sep 10, 2008 at 9:45 AM, Joseph X. Jude <id804097@...> wrote:

> Hi: I am trying to compile a simple j2me program.
>
> from javax.microedition.midlet import *
> class MyFirstMidlet(MIDlet):
>     def __init__(self):
>         print "hello world"
>         self.destroyApp(False)
>
>     def startApp(self): pass
>     def pauseApp(self): pass
>     def destroyApp(self,unconditional):pass
>
> with the compile command:
>
> jythonc -i --core -b MyFirstMidlet.jar --jar C:\WTK2.5.2\lib\midpapi20.jar
> --jar C:\WTK2.5.2\lib\cldcapi11.jar -C "C:\Program
> Files\Java\jdk1.5.0_03\bin\javac.exe" MyFirstMidlet.py
>
> It produces two class files - MyFirstMidlet$_PyInner.class &
> MyFirstMidlet.class
>
> Once compiled, I need to preverify for j2me (I'm referencing
> http://today.java.net/pub/a/today/2005/02/09/j2me1.html?page=2). When I do
> that I get an error - java/lang/NoClassDefFoundError: java/lang/Object
>
> Preverify command is: C:\WTK2.5.2\bin\preverify.exe -classpath
> C:\WTK2.5.2\lib\midpapi20.jar;C:\WTK2.5.2\lib\cldcapi11.jar MyFirstMidlet
>
> then I tried to compile the .java generated by jython. It throws errors -
> cannot find symbol.
>
> BTW: It is - Jython 2.2.1 on java1.5.0_03
>
> Can anyone help me plese? Thank you in advance,
> Joseph
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Jython-users mailing list
> Jython-users@...
> https://lists.sourceforge.net/lists/listinfo/jython-users
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users
LightInTheBox - Buy quality products at wholesale price!