1.安裝好jdk
2.去官網上下載好eclipse, 去eclipseme.org上下載eclipseme,http://www.oracle.com/technetwork/java/download-135801.html下載
(wiress toolkit)wtk,WTK需要安裝。
3.進入eclipse選擇help
4.選擇install new software
5.點擊add
6.在Add Repository中點擊archive...
7.選擇下載好的eclipseme.feature包,zip格式的
8.ok
9.選擇select all
10.next
11.next
12.選擇I accept the terms of the licese agreement
13.finish在安裝期間要連網,有東西從網上download
14.安裝完畢,選擇重啟eclipse
15.選擇window中的preferences
16.選擇j2me->Device Management->import
17.選擇你安裝好的wtk檔案夾,例如:D:/WTK2.5.2_01
18.Refresh
19.Select All
20.選擇一個裝置,預設就行
21.Apply
22.ok
23.選擇File->new->other->j2me->j2me midlet suite
24.next後輸入項目名稱,next,next
25.finish
26.項目建立完成,右鍵src->new->j2me->j2me midlet
27.name中輸入類名hello,finish
28.在hello中輸入
import javax.microedition.lcdui.Choice; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.List; import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; public class hello extends MIDlet { Display d = null; List list; public hello() { // TODO Auto-generated constructor stub } protected void destroyApp(boolean arg0) throws MIDletStateChangeException { // TODO Auto-generated method stub } protected void pauseApp() { // TODO Auto-generated method stub } protected void startApp() throws MIDletStateChangeException { // TODO Auto-generated method stub String []s={"hello","game"}; list=new List("我的遊戲", Choice.IMPLICIT, s, null); d=Display.getDisplay(this); d.setCurrent(list); } }
29.右鍵項目名run as->run configurations->右鍵wireless toolkit emulator->new
30.可以把name中的new_configuration改成你自己的名
31.在executable中選擇midlet->search
32.選擇hello,如果有包名,帶上包的名稱
33.ok
34.點擊apply
35.點擊run