×

Discussion Board

Page 10 of 10 FirstFirst 12345678910
Results 136 to 142 of 142

Thread: Python for UIQ

  1. #136
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    Re: Python for UIQ

    Quote Originally Posted by cassioli View Post
    It's just a matter of finding out WHICH (damned) parameters they are!!
    Have you ever successfully compile a normal .py file into .jar file by using jythonc with Java 1.5 or above?
    I think it requires similar parameters like this situation. The only difference is you have to use older version of Java.

    I think CPython is definitely dead. Just like my UIQ phone
    My P910i now servers as a PDA
    It's really interesting to explore how cross-platform language like Python and Java prove their strength

    I plan to develop a light weight GUI component for UIQ 2 as CPython is now dead Hope that I'd have time

  2. #137
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: Python for UIQ

    Quote Originally Posted by duc.nguyenanh View Post
    Have you ever successfully compile a normal .py file into .jar file by using jythonc with Java 1.5 or above?
    AFAIR (I stopped testiing long time ago...), I successfully compiled to jar, but was never able to LAUNCH the jar.

  3. #138
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    Re: Python for UIQ

    Quote Originally Posted by cassioli View Post
    AFAIR (I stopped testiing long time ago...), I successfully compiled to jar, but was never able to LAUNCH the jar.
    Can you provide me steps that you have used to run your jar file?
    I made a small Jar file and successfully ran it, but I cannot post here as this forum doesn't support file upload.

    I also curious about your question at compile .py file to .class file.
    jythonc always creates .class files during compilation process. They are put at jpywork directory which is located at the same directory at your .class files.
    Last edited by duc.nguyenanh; 2008-06-11 at 04:10.

  4. #139
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    Re: Python for UIQ

    An interesting note:
    If you compile .java file with javac whose version is higher than 1.1, pJava always informs that it cannot find the class (Exception: java.lang.NoClassDefFoundError).
    I'm trying to compile jython library source, but I don't know where the start point is.

  5. #140
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: Python for UIQ

    Quote Originally Posted by duc.nguyenanh View Post
    An interesting note:
    If you compile .java file with javac whose version is higher than 1.1, pJava always informs that it cannot find the class (Exception: java.lang.NoClassDefFoundError).
    I'm trying to compile jython library source, but I don't know where the start point is.
    I didn't check my old notes about this issue, but I think I remember this is just what happened to me: I tried compiling the .java file created by jythonc, I always obtained the infamous java.lang.NoClassDefFoundError , which can mean all and nothing...

    No better luck I had with the .class created by jythonc, which I was not able to get working once inside a .jar .

    My skill in java is very low: the classpath stuff is completely confusing me, being "messed up" among compile-time and run-time.
    I guess it's better for you not even to know which my attempts were to compile .py to .jar , tyehy'll probably only confuse you!
    just keep trying!

  6. #141
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    Re: Python for UIQ

    Quote Originally Posted by cassioli View Post
    I didn't check my old notes about this issue, but I think I remember this is just what happened to me: I tried compiling the .java file created by jythonc, I always obtained the infamous java.lang.NoClassDefFoundError , which can mean all and nothing...

    No better luck I had with the .class created by jythonc, which I was not able to get working once inside a .jar .

    My skill in java is very low: the classpath stuff is completely confusing me, being "messed up" among compile-time and run-time.
    I guess it's better for you not even to know which my attempts were to compile .py to .jar , tyehy'll probably only confuse you!
    just keep trying!
    classpath is only a environment parameter. It is used by JVM to locate library packages and your .class files.

    I've successfully run a small .jar file in my phone.
    The procedure is as following:
    1. Obtain the jython.jar from jython2.1 directory. (jython2.2 cannot work as it requires jre 1.4.0 or above while pJava is equivalent to jre1.1.1)

    2. Using jythonc to compile .py file to .jar file. I cannot complete this step as jdk 1.1.8 is not compatible with Vista. jythonc hangs after it produces .java file. But I still have .java file to continue. It is placed in jpywork directory in current directory.
    Command for this step is:
    jythonc -a -j testJar.jar testJar.py

    3. Compile .java by jdk1.1.8: We have to set classpath to jython.jar and library path of jdk1.1.8
    Command:
    "C:\program files\java\jdk1.1.8\bin\javac.exe" -classpath "C:\program files\java\jdk1.1.8\lib\classes.zip;C:\jython2.1\jython.jar" testJar.java

    4. After third step, I get few .class files: testJar.class, testJar$_PyInner.class and testJar$testButton.class. Then use jar utility to pack them in a .jar file by following command:
    "C:\program files\java\jdk1.1.8\bin\jar.exe" -cvf0 testJar.jar testJar.class testJar$_PyInner.class testJar$testButton.class

    5. Copy testJar.jar and jython.jar to a same directory in the phone. Set jRun.txt to:
    -cp "C:/classes;C:/classes/testJar.jar;C:/classes/jython.jar" testJar

    6. THen invoke JRun and enjoy

    Do you have same procedure with what I did?

  7. #142
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: Python for UIQ

    Quote Originally Posted by duc.nguyenanh View Post

    6. THen invoke JRun and enjoy

    Do you have same procedure with what I did?
    Who knows? I don't remember.... But... who cares? You got it!

    I hop I'll find a bit of time to test your procedure.

    Thanks for your efforts.

    Wanna try compiling my jython program to turn UIQ phones into GPS antitheft in the meantime?

Similar Threads

  1. Please help installing Python libraries on S60
    By ericroijen in forum Symbian
    Replies: 11
    Last Post: 2009-07-18, 10:43
  2. Python for Series 60 released on Forum Nokia!
    By eriksmartt in forum Symbian
    Replies: 5
    Last Post: 2009-07-14, 17:00
  3. Python 2.2? 2.3?
    By mflux in forum Symbian
    Replies: 3
    Last Post: 2006-06-26, 22:36
  4. Python C++ Extension with Callback crashing
    By diggerdeep in forum Symbian
    Replies: 2
    Last Post: 2005-11-10, 16:33
  5. Replies: 0
    Last Post: 2004-07-18, 00:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×