1.系统要求
pentium 100以上cpu
64mb 内存
windows nt workstation 4.0(service pack 3)或windows 98
6mb自由硬盘空间
java 2 sdk, standard version, 版本1.2.2或者更高
2.安装java 2 sdk
在使用motorola sdk之前必须安装jdk,standard edition。请从http://java.sun.com/products/jdk 下载jdk,并按照sun的指导安装到pc中。
3.安装motorola sdk
安装之前请先卸载以前版本的motorola sdk:
1. 选择"开始à设置à控制板"
2. 选择"添加/删除程序"
3. 查找到"motorola sdk components for the j2me platform"
4. 点击"卸载"
5. 用资源管理器删除"/motosdk"目录
安装sdk:
1. 运行"motorola_sdk.exe"
2. 按照提示安装程序
注意:安装程序需要口令,请向motorola公司索取。
4.编写第一个程序
在目录"/motosdk/demo/midlets/com/mot/j2me/midlets/tutorials/"中,用编辑器创建文件"helloworld.java"。
/*
* helloworld.java
*
* june 27, 2000
*
* ? copyright 2000 motorola, inc. all rights reserved.
* this notice does not imply publication.
*/
package com.mot.j2me.midlets.tutorials;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
/**
* a simple hello world midlet
*
* @see midlet
*/
public class helloworld extends midlet {
/**
* main application screen
*/
private form mainscreen;
/**
* a reference to the display
*/
private display mydisplay;
/**
* creates a screen for our midlet
*/
helloworld() {
mydisplay = display.getdisplay(this);
mainscreen = new form("hello world");
/*
* create a string item
*/
stringitem stritem = new stringitem("hello", "this is a j2me midlet.");
mainscreen.append(stritem);
}
/**
* start the midlet
*/
public void startapp() throws midletstatechangeexception {
mydisplay.setcurrent(mainscreen);
}
/**
* pause the midlet
*/
public void pauseapp() {
}
j2me开发步骤
/**
* called by the framework before the application is unloaded
*/
public void destroyapp(boolean unconditional) {
}
}
5.编译
编译"helloword"
1.在命令行窗口中,进入目录"/motosdk/demo/midlets"
2.输入"compileall com/mot/j2me/midlets/tutorials/helloworld.java"
6.运行
运行"helloword"
1.在命令行窗口中,进入目录"/motosdk/scripts"
2.输入"runemul com.mot.j2me.midlets.tutorials.helloworld"
闽公网安备 35060202000074号