background image

    2)、在开发板/etc/init.d/rcS 文件里加入如下
        JAVA_HOME=/home/j2me
        export PATH=$JAVA_HOME/bin:$PATH
        export CLASSPATH=.:$JAVA_HOME/lib

    3)、经典的 HelloWorld
        cd /home/j2me/bin
        ./cvm -cp ../testclasses HelloWorld
   
        

 

可以看到输出了 HelloWorld.

    4)、来个全面测试
        ./cvm -cp ../testclasses.zip Test

        *Number of command line arguments: 0
        Starting test1
        ...recurse
        ...recurse
        ...recurse
        ...link
        ...link
        ...link
        Starting test1 again
        ...recurse
        ...recurse
        ...recurse
        ...link
        ...link
        ...link
        test6: Caught inner java.lang.NullPointerException
        test6: Caught outer java.lang.NullPointerException
        Testing Array Copy
        *TestE exception thrown because "I'm feeling Testy"
        *<clinit> threw java.lang.ExceptionInInitializerError
        *<clinit> threw java.lang.NoClassDefFoundError: StaticE
        c1 = class [LTest;
        c2 = class [[LTest;
        c3 = class [LC;
        c4 = class [[LC;
        c1.modifiers = 1041
        c2.modifiers = 1041
        c3.modifiers = 1040
        c4.modifiers = 1040