一、选用sun的phoneme https://phoneme.dev.java.net/
二、下载
http://download.java.net/mobileembedded/phoneme/advanced/phoneme_advanced-mr2-dev-src-b97-20_nov_2008.zip
三、解压
unzip phoneme_advanced-mr2-dev-src-b97-20_nov_2008.zip
相关推荐文章《mini2440 移植 Java虚拟机的错误处理 》 http://www.linuxidc.com/Linux/2011-08/41914.htm
四、修改makefile
cd phoneme_advanced_mr2/cdc/build/linux-arm-generic
gedit GNUmakefile
修改 CVM_TARGET_TOOLS_PREFIX=/usr/local/arm/4.3.2/bin/arm-linux- 为自己的交叉编译器的地址
修改 USE_AAPCS ?= false 为 true
五、输出PATH
export PATH=/usr/local/arm/4.3.2/bin/:$PATH 为自己的交叉编译器的地址
六、编译
make
七、如果是使用Ubuntu的朋友,可能要安装sun-java6-jdk和另外的一两个工具
Ubuntu下Java SDK安装配置具体参考见这篇 http://www.linuxidc.com/Linux/2011-08/41913.htm
另外的一两个工具可以通过 apt-get install 来安装(出错时会提醒的)
八、出错
../../src/linux-arm/javavm/runtime/segvhandler_arch.c:45:26: error: asm/ucontext.h: No such file or directory
../../src/linux-arm/javavm/runtime/segvhandler_arch.c: In function 'handleSegv':
../../src/linux-arm/javavm/runtime/segvhandler_arch.c:224: error: dereferencing pointer to incomplete type
../../src/linux-arm/javavm/runtime/segvhandler_arch.c:285: error: dereferencing pointer to incomplete type
../../src/linux-arm/javavm/runtime/segvhandler_arch.c:285: error: dereferencing pointer to incomplete type
../../src/linux-arm/javavm/runtime/segvhandler_arch.c:286: error: dereferencing pointer to incomplete type
../../src/linux-arm/javavm/runtime/segvhandler_arch.c:294: error: dereferencing pointer to incomplete type
修改 segvhandler_arch.c 文件
gedit ../../src/linux-arm/javavm/runtime/segvhandler_arch.c
修改
#define ucontext asm_ucontext
#include
为
//#define ucontext asm_ucontext //注释掉这句
#include //去掉arm/
九、编译
make
编译成功!
ls
可以看到在当前目录有
bin lib testclasses.zip
十、测试
1)、拷贝上面三个文件与文件夹到开发板/home/j2me目录
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'
* threw java.lang.ExceptionInInitializerError
* 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
*FloatMIN =1.4E-45
*FloatMAX =3.4028235E38
FloatMIN (the int bits) =1
FloatMAX (the int bits) =2139095039
java.lang.IllegalArgumentException: too many dimensions
at java.lang.reflect.Array.multiNewArray(Native Method)
at java.lang.reflect.Array.newInstance(Unknown Source)
at Test.testDeepArrayConstruction(Unknown Source)
at Test.main(Unknown Source)
at sun.misc.CVM.runMain(Unknown Source)
Constructed an object of type
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[LTest;
finally!
Requesting GC with a latency request of 2 seconds
(Turning GC tracing on)
Sleeping 5 seconds, and waiting for GC's
Woke up! Cancelling latency request
.............
*CONGRATULATIONS: test Test completed with 411 tests passed and 0 failures
*Output lines starting with a * should be checked for correctness
*They can be compared to src/share/javavm/test/TestExpectedResult
*CONGRATULATIONS: test Test completed with 411 tests passed and 0 failures
这句话意味着什么,我就不说了~~ 恭喜你!
上一篇:mini2440 移植 Java虚拟机的错误处理
下一篇:mini2440通过NFS启动的U-Boot参数设置
推荐阅读最新更新时间:2024-11-10 16:11
设计资源 培训 开发板 精华推荐
- LT6012 的典型应用 - 双路/四路 135 uA、14nV/rtHz、轨到轨输出精密运算放大器
- #第八届立创电赛#桌面时钟
- OP249GSZ-REEL7瞬态输出阻抗测试治具典型应用电路
- ADR431B 2.5 Vout 超低噪声 XFET 电压基准的典型应用,具有灌电流和拉电流能力
- 使用 Analog Devices 的 ADN2847 的参考设计
- STR-NIS5020-GEVB:Strata Enabled NIS5020 12V、14mΩ、10A eFuse
- EVAL-CN0385-FMCZ,基于 AD4003 18 位、2 MSPS、PulSAR ADC 的评估套件
- 使用 Infineon Technologies AG 的 OM7654SM 的参考设计
- 使用 Infineon Technologies AG 的 OMR9605SF 的参考设计
- RDR-321 - 17W 双输出反激式转换器