关于Eclipse中的J2ME插件的问题

来源:互联网 发布:怎样用u盘重装mac系统 编辑:程序博客网 时间:2024/06/07 11:09


感觉EclipseMe的插件总是有问题。同样的MIDlet2.0程序,有的时候会出现
** Error installing suite (39): The JAD matches a version of a suite already installed.
Execution completed.错误(MIDlet 1.0不知道有没有)

笔者配置:
CPU :P4 2.4G,Memary:1GB。HardDisk 80G*2;
Windows 2000 Server
Eclipse 平台  版本:3.0.1
EclipseMe 版本:0.6.0
WTK:2.2
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)


上google查了一下资料。发现2个文章一个是俄罗斯文的(看不懂了)。另一个是sun社区的文章。
如下:



Error installing suite (39)
Author: tgkang
Mar 19, 2004 1:17 AM  
Could anyone help me about the error below that I encountered when I executed an MIDP sample program via my web server?

Error installing suite (39): The JAD matches a version of a suite already installed

Thanks in advance


Re: Error installing suite (39)
Author: shmoove
In Reply To: Error installing suite (39)
Mar 19, 2004 3:26 AM  
Reply 1 of 1
The OTA specs say that a MIDlet Suite will be replaced if a newer version of it is downloaded. If you try downloading the same version of the Suite they don't say that it should be replaced. On some phones this is implemented as a simple warning that tells you you already have this version and ask you if you want to replace it, and on others the implementation (like yours apparently) just won't let you install an existing version. So you can:
a) delete the MIDlet and then download the same version, or
b) change to MIDlet version attribute in the jad to a newer version than whats installed.



看了看,大概是叫重新,安装MIDlet了。后来发现,这个是和EclipseMe虚拟的Device有关。(因为我用J2ME Wireless Toolkit 2.2编译运行没有问题)。换了一下Device,选择QwertyDevice就没有问题了。不过这个东西不像手机了,看起来就是一个pda。还在能运行了,具体界面用notepad+WTK改吧。

不过选择了QwertyDeivce运行后,在选择其他Device运行出错的几率减小了。

还有就是用Eclipse开发时,res路径似乎不是默认资源路径。在程序中需要显式写入此路径,这个和 WTK兼容就出了问题。(当然本人初学,这个配置不清楚)。
例如:/res/img/chessboard.png 是在Eclipse中的路径。
            /img/chessboard.png 是在WTK的路径。
好在Java是面向对象的,这些差异就没什么了。

原创粉丝点击