博客园  :: 首页  :: 联系 :: 管理

第一次用JBuilder2006写J2ME遇到的问题及解决方法:

Posted on 2007-04-18 01:46  sunrack  阅读(514)  评论(1)    收藏  举报

第一次用JBuilder2006写J2ME遇到的问题及解决方法:

原来学J2ME的时候,一直用的是Eclipse + EclipseMe,
周一上午没有上班,在书店买了本书,J2ME的(这以经是第三本了,可见我学它的决心).随书光盘里有视频讲解.看了一下,用的都是JBuilder,于是就下了一个JBuilder2006.

不曾想,调试第一个程序就遇到了困难.

环境:JBuilder2006 + WTK2.2(WTK2.3)
错误提示:
java/lang/ClassFormatError: Bad version information

解释:这是JBuilder2006的一个错误:
http://web.mit.edu/jbuilder_v2006/distrib/sun4x_510/JBuilder2006/readme.html

[227771] If you use WTK 2.2 and earlier, and you get the message "ALERT: java/lang/ClassFormatError: Bad version information" when you launch the MIDlet, you may need to set the target VM in JBuilder to any targets other than Java 2 SDK, v 5.0 (generics enabled). This option is on the Build|Java page of the Project Properties dialog box.

大意是:
如果你用的是WTK2.2或更高的版本,得到这个错误的时候,你应把JBuilder2006的目标VM设置为非:Java 2 SDK, v 5.0(这个是默认选项).
这个选项在:工程的属性->Build->Java项里.

做完这个操作后,Rebuild下这个工程之后,就不会有这个错误了.