Workers must be good, and must first take care of the J2ME development environment.

zhaozj2021-02-16  43

Since the version of Eclipseme is still relatively low, at 0.5 (if I don't make a mistake), the installation method has changed, as of the latest version of 11.18, should be 0.6.1, if you install the high version, please Refer to the article in the connection below, http://www.j2medev.com/Article_show.asp? ArticleID = 144 If it is 0.4.x, you can refer to this article. Since the WTK does not provide the ability to edit code, this article tells how to build a J2ME development environment using Eclipse. After reading this article, the reader will be able to use J2SDK1.4.2_03 WTK2.1 Eclipse3.0RC2 EclipseMe0.4.1 for J2ME development. I hope to help with novices.

You should download the relevant software from the following address. J2SDK1.4.2_03 wtk2.1: http://java.sun.comeclipse3.0rc2 http://www.eclipse.orgeclipseme0.4.1 http://sourceforge.net The J2SDK1.4.2_03, WTK2.1 is installed in sequence Eclipse3.0RC2 and EclipseMe0.4.1, environment variables should be set after the environment variable ClassPath, Path and Java_Home after installation J2SDK, which I will not say more. After setting, you can write a test program HelloWorld.java for testing. Enter Javac HelloWorld.java after the command line After getting a Class file, enter Java HelloWorld to output Hello World to the screen to indicate the J2SDK installation correct. Public class helloworld {public static void main (String [] args) {system.out.println ("Hello World");}} Next, WTK2.1 is installed, and the general application is installed. After installing, you can run some demo from the KTK2.1, if the WTK2.1 is running, if the WTK installation is correct, let's take the development environment of Eclipse, and Eclipse is very simple, you directly extract Eclipse3.0rc2 C: / Eclipse is OK. You can see the Eclipse running interface directly to run eclipse.exe. If you have not used Eclipse, then you can look at the help documentation, do your small Java project to run. Below we have to install the eclipseme.0.4.1 plug-in, turn off the Eclipse and extract EclipseMe0.4.1 to C: / Eclipse / PLUGIN, restart Eclipse, select Windows-> Preferences to configure the J2ME development platform. Select Platform Components-> Wireless Toolkits, right-click Add Wireless Toolkit will appear below Select your WTK installation path After selecting it. You set up the J2ME development platform. Since CLDC / MIDP is flexible, you can also create additional platforms to use other simulators, please refer to the help documentation in Eclipseme. Below we create a new small project to explain how to use it to develop J2ME projects, select File-> J2ME MIDLET Suite, then fill in the name of the project such as HelloWorld, choose the next step, so we will create A J2ME project is next to select the project helloWorld from Package Explorer and then build a J2ME MIDET name named hellomidlet, then the editing code, the code is as follows: / * * Hello.java * * Created on August 26, 2001, 10 : 30 pm * /

Package com.paulsjavabooks.instantj2me.chapter1;

Import javax.microedition.midlet. *; import javax.microedition.lcdui. *;

/ ** * * @Author paul_tremelett * @version 1.0 * / public class hello extends midlet {

Private display; public hello () {display = display.getdisplay (this);}

Public void startapp () {textbox t = new textbox ("Hello MIDET", "Hello Midp!", 256, 0); Display.SetCurrent (T);}

Public void pauseapp () {}

Public void destroyApp (Boolean Unconditional) {}} Select Run-> Run from the menu to configure the running environment. After setting, the mouse click RUN, if not, the program will run normally and will display the following interface.

OK, this is how to build a J2ME development environment, the relatively rough, in fact, the best familiar method is that you immediately install and then start writing the program test. Practice is the best teacher?

转载请注明原文地址:https://www.9cbs.com/read-21169.html

New Post(0)