注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

WA!Peter

广州天河, 香港火炭,深圳罗湖, 北京国贸

 
 
 

日志

 
 

mac eclipse j2me  

2010-01-07 16:06:50|  分类: mac |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
=====Short version=====
- Eclipse Galileo 
- MTJ  (Mobile Tools for Java)
- mpowerplayer     \Applications\mpp
- WTK 2.5.2 (optional),  need to copy the whole directory: \WTK2.5.2\wtklib\Linux to
  \WTK2.5.2\wtklib\Mac
- check: important notes   (e.g. "".getClass().getResourceAsStream()  not work)
- setup:  Eclipse, Preference J2ME(?)  setup WTK root \Application\WTK2.5.2
- setup:  Eclipse, Preference J2ME(?)  Import toolkit : browse \Applications\mpp
- setup: Eclipse, custom preverify path(?) \Applications\mpp\osx\preverify

=====Long version=====
some notes on setting up J2ME platform on Mac OS X (Leopard specific, because i am using it)
not yet verified, may work or may not work

important notes:
"".getClass().getResourceAsStream(filename))  does not work in mpowerplayer,
  try:  midlet.getClass().getResourceAsString(filename)  midlet is the instance of Midlet
- write your own J2ME Emulator in pure Java (this is a starting point to create something like MicroEmu)
http://www.gamesondeck.com/feature/1491/ditch_the_emulators_how_to_code_.php?print=1
- if you have "kemulator.jar"  in the project library, remove it before "Convert to midlet project"
- if a "Convert to midlet project" hangs (no response for long time), try to create a new project and
  copy the src, res folder and do it again.

Download this:   mpowerplayer claim to be the only option to do J2ME MIDP2.0 - with native preverify
http://mpowerplayer.com/sdk
my version:  mpp-sdk-1185.zip  
note: you also need Rosetta for Leopard, it is in the optional Install pack of Leopard disc

Install Eclipse (Gallileo, Build id: 20090920-1017)
- i am using 32bits cocoa version, i guess not much differences if you are using 64bits

Mobile Tools for Java (MTJ - which is the new name for EclipseME)
http://www.eclipse.org/dsdp/mtj/

MicroEmu  the J2ME implementation based on pure Java (also include Android!)
http://code.google.com/p/microemu/
(peter: i didn't use it)

Sun J2ME WTK 2.5.2 for Linux
http://java.sun.com/products/sjwtoolkit/download.html
tricks:  it is for Linux, to run the ktoolbar (assume u install to /Applications/wtk)
cd /Applications/wtk/wtklib
cp -R Linux Mac
## this one works on opening the ktoolbar, but preverifier need further actions

all in one:
http://startofentry.blogdns.org/space/MicroEmulator+for+MacOS+j2me+development


some say need antenna, wtk for Linux (from Sun), i guess they are optional.

alternative is to use NetBeans 6.1 which i have never used (probably too slow)
http://blogs.sun.com/lukas/entry/mobility_on_leopard

more info from another all-in-one (WTK seems to be necessary)
http://blog.dark-ipl.com/jme-development-on-mac-osx-leopard-1056.php

After one day of searching, here is my tools and configuration:

  1. Install eclipse (mine is 3.4.1). http://www.eclipse.org
  2. Install MJT (Mobile Java Tools) plugin for eclipse from eclipse’s update site.
  3. Install MPowerPlayer SDK and configure it to work with eclipse MJT ( http://mpowerplayer.com/sdk )
  4. Download the Sun WTK for Linux then do some porting to work with the configuration (if necessary).
  5. Try to build or import an application and see if it works as expected!.

I assumed that we already know step 1 to 2 (if not, please see eclipse the website).

Jump to step 3, visit the site and download the SDK. Run eclipse and then go to Eclipse -> Preferences.

Java ME -> Device Management -> Import. Set to mpowerplayer directory. If it founds the mpowerplayer SDK, then click finish.

Now you can choose the mpowerplayer SDK and then build a hello world!. :D

Step 4 is useful if you want to add midp or cldc library from Sun WTK, because in my case when i import my previous work on Windows to Mac, it runs not as expected and i think maybe i should add the same library as on Windows (of course!). And because Sun just support Windows and Linux, so i think i can port the Library from Linux distribution, and it works as good as on Windows.

  评论这张
 
阅读(503)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017