eclipse+wtk configuration j2me development environment

Download the latest version of the necessary software,
1 eclipse 3.2.2 Go to the following address to find
  http://www.eclipse.org/downloads/
2 eclipseme 1.6.7
  http://sourceforge.net/project/showfiles.php ?group_id=86829
3 wtk2.5 (Sun Java Wireless Toolkit 2.5 for CLDC) Wireless Development Toolkit provided by sun
  http://java.sun.com/products/sjwtoolkit/zh_download-2_5.html

Installation and configuration steps
  1. Install Turn to Eclipse3.2.2 (jdk1.5 or above must be installed first, not explained here)
  2. Install EclipseMe1.6.7
  3. Install WTK2.5
  4. Test HelloWorld
  5. Use the Nokia emulator to test
 
the configuration steps (necessary )
  1.1 Transfer to Eclipse3.2.2
    , unzip the downloaded zip file and put it directly into the root directory of disk c. Of course, you can put it anywhere you like. For the convenience of description, put it in c:/eclipse 1.2 Run
  eclipse , if it can start normally, it means that the jdk is installed correctly, otherwise, you may need a new version of jdk, go to the sun website to download it.
  1.3 Unzip eclipse1.6.7 into a temporary directory, put the directory and files
      Just copy all the plugins
      features
      site.xml
      to the eclipse directory.
  1.4 Start eclipse3.2.2 From the menu windows->references... enter
      the tree directory on the left of the references panel, there should be a J2ME item.
  1.5 Continue to install WTK2.5, install the main directory to C:/WTK25, and
 
  install software is installed. The following is the most important configuration part
  . 1.6 Modify the configuration of Eclipse to bind EclipseME Framework
      1.6.1 Find the configuration file config.ini in the eclipse configuration directory configuration
      1.6.2 Open it with a text editor and add a property definition
            osgi.framework.extensions=eclipseme.core.hooks
            If the property already exists, set the value Add note to eclipseme.core.hooks
            : This line must be added in front of eof=eof in config.ini, and cannot be added behind. Otherwise, Eclipse may fail to start.
      1.6.3 Save config.ini
      1.6.4 Restart eclipse
  1.7 Modify the build path and debug options of eclipse
      1.7.1 Separate the source code from the output
        1.7.1.1 From the menu windows->references... Enter
        1.7.1.2 Expand the java item in the references panel, and then click build path
        1.7.1.3 By default, "source and output folder" The "project" of the item is selected. We modify this default setting and select "folders"
             so that eclipse can separate the source code from the output.
      1.7.2 Modify the exception suspension settings and timeout of the debug option (very important)
        1.7.2.1 Enter 1.7.2.2 from the menu windows->references...
        Expand the java item in the references panel, and then click debug
        1.7.2.3 In Suspend In the Execution item,                uncheck
               "Suspend execution on uncaught exceptions" and
               "Suspend execution on compilation errors"         1.7.2.4 At the bottom of the panel, set the debugger timeout(ms) to 15000 (this parameter is too important, Must remember to change)   1.




     1.8.1 Enter from the menu windows->references...
     1.8.2 In the tree on the left side of the references panel, expand the "J2ME" item
     1.8.3 Select Devices Management, click the "Import..." button on the right
     1.8.4 In In the pop-up Import Device panel, click the button "browse...", and then select the bin directory of WTK. After confirmation, click the "refresh" button to automatically
           find the emulator. Click the "finish" button to return.
     1.8.5 In this way, the emulator is ready. If you need other emulators, you can do so.

2 Create a MIDlet application.
    There are two ways to create a MIDlet application.
    Method 1: (Applicable to starting from scratch) Create a MIDlet project.
        From the menu File -> New -> Project, enter the project panel
        and expand J2ME. There is only one J2ME MIDlet Suite.
        After entering the project name, it will be You can choose the emulator you need, just go all the way.
    Method 2. (Suitable for adding MIDlet programs to existing projects)
        From the menu File -> New ->



        If you choose J2ME MIDlet, then create a MIDlet, choose J2ME MIDlet Suite, then create a MIDlet project.
      
3 Debugging and running
    In the project, click the right button on the main class that needs to be debugged or run, and select
     run as -> Emulated j2me Midlet
     or
     debug as -> Emulated j2me Midlet from the right button menu
     to run and debug

4 Packaging
    Right-click on the project directory that needs to be packaged, and select
    j2me->create package from the right-click menu.

5. The configuration of jad
    is omitted.
==================================================== ==================================

Eclipse installation and configuration

A. Installation:
1. Install JDK1.4.2 (WTK2.2 requires above 1.4.2)
2.Install WTK
3.Install Eclipse
4.Unzip Eclipseme to the plugin directory of Eclipse. Versions after Eclipseme 0.5.5 do not apply to this method, and the specific configuration method will be described later.
    As a plug-in for Eclipse, EclipseMe is dedicated to helping developers develop J2ME applications. EclipseMe does not provide developers with wireless device simulation devices, but closely connects the practical simulators of various mobile phone manufacturers to the Eclipse development environment, providing developers with a seamless and unified integrated development environment. You can download EclipseMe for free at http://www.eclipseme.org/. The latest version at the time of writing this article is 1.5.0. For the sake of stability, eclipseme.feature_1.2.3_site.zip is selected here as the Everyone demo.
    In addition to Eclipse and EclipseMe, the java runtime environment and some mobile phone emulators are required to complete the installation. The list of tools for completing this article is listed below:
   (1. JDK 1.4.2           
   (2. Eclipse 3.1.2       
   (3. Eclipse 3.1.1 language pack NLpack1_FeatureOverlay-eclipse-SDK-3.1.1.zip and NLpack1-eclipse-SDK -3.1.1a-win32.zip
   (4. EclipseMe 1.2.3 eclipseme.feature_1.2.3_site.zip
   (5. Sun WTK 2.2 (sun's general simulator)
   (6. Nokia Developer's Suite 2.2 (Nokia Developer's Suite, including Simulators for several typical models)

A-1 Eclipse installation and Sinicization
    The installation process of Eclipse is simpler, in fact, it is just a decompression process. Copy the Eclipse SDK compressed package eclipse-SDK-3.1.2-win32 you downloaded to your target directory. Here we take the root directory of drive D as an example, and then extract it to the current folder.
    Eclipse3.1.2 Sinicization link method summary:
(1. Download the language pack: NLpack1_FeatureOverlay-eclipse-SDK-3.1.1.zip
NLpack1-eclipse-SDK-3.1.1a-win32.zip
(2. Unzip the two language packs, and Merge the two, that is, merge the folders with the same folder name into one, and finally get an eclipse folder.
(3. Create two folders language and links in the Eclipse installation directory. And merge the two folders in step 2 Copy the folder to the language folder (note: copy the entire eclipse folder obtained after decompression).
(4. Create a text file in the links folder: links.txt. The content is the language folder path, for example: path= d://eclipse//language
(5. Restart Eclipse.
    Note: If there are some English words that are not Chinese, you can delete the .settings folder in the /eclipse/configuration directory, restart eclipse and it will be completely Chinese.

A -2 EclipseMe plug-in installation
    Select "Help/Software Update/Find and Update" in Eclipse, select "Search for new features to install" in the pop-up dialog box, and specify the EclipseMe compressed file eclipseme.feature_1 in the pop-up box of "New Archived Site" .2.3_site.zip. After clicking OK, you can see that Eclipse has searched for the corresponding plug-in. Select the EclipseMe check box, accept the agreement, ignore the feature verification, and finally restart the console, and the EclipseMe plug-in has been successfully installed.
    In order to verify that EclipseMe has indeed been installed, after we restart the workbench, open "Window/Preferences", we can see a J2ME option, at this time, the first step of Eclipse mobile development, we have successfully taken up!
    Note: After installing EclipseMe, we need to make a small change to the original Eclipse configuration. Since we need to start the mobile phone emulator first during mobile development, the default setting of Eclipse in Debug mode will fail until the emulator starts. It is very simple to modify this point. In the "java/debugging" of the preferences, change the default setting to select the window--preferences--JAVA--debugging--remove the first and second hooks, and put the bottom debugging The delay setting is 15000. The debug mode can be successfully started.

A-3 Load manufacturer's emulator
    EclipseMe provides us with an integrated development environment, but these alone are not enough, we also need one or more mobile phone emulators as the actual carrier for the program to run. At present, major mobile phone manufacturers have various types of mobile phone emulators, and Sun also provides a general-purpose emulator. Sun WTK and Nokia Developer's Suite are used here to demonstrate.
   The following binds WTK to Eclipse. Find the path "Window/Preferences/J2ME/Platform Component", right-click the wireless toolkit on the right side of the dialog box, we can add the existing emulator in the current system. After clicking the "Browse" button, we select the installation directory of WTK. EclipseMe will automatically analyze the current simulator type and display it. After confirmation, we found that a lot of configuration information about WTK has been added to the Platform Component column. At this time, WTK has been integrated into EclipseMe by us.
    Nokia has a variety of mobile phone emulators, in order to unify management, it launched the management software Developer's Suite for centralized management of these emulators. Developer's Suite itself is a toolkit that can run independently, and it can also be bound by EclipseMe, so that developers can work efficiently in the same working environment. Here, we're using Nokia Developer's Suite 2.2, which even comes bundled with Eclipse when installed!
    First, download the installation file from the Nokia forum. If there is an old version of Developer's Suite in the computer, you need to uninstall the old version first. Nokia's development kit is provided to the developers of Nokia Forum, so after accepting the installation agreement, you need to provide the user name and installation serial number in Nokia Forum. Don’t worry if you don’t have a serial number for the first installation. You don’t need to fill in anything in the input column and just ignore it. Developer’s Suite will let you choose a proxy networking mode (if you don’t use a proxy server to access the Internet, choose no proxy), and then ask you Enter your user name and password in Forum Nokia to register. After the registration is successful, the serial number corresponding to the user name will be sent to your mailbox, check it, and you can continue! (Sometimes Nokia's behavior of sending the serial number will be very slow, there is no way but to wait).
    After completing the certification, you will find that Developer's Suite 2.2 provides a variety of installation methods, including independent installation or direct integration with Eclipse. If you choose to integrate with Eclipse, you must provide the current Eclipse installation directory. If you choose independent installation, after restarting the system, select the installation directory of Developer's Suite in "Preferences/J2ME/Platform Components" in the same way as adding Sun WTK. After confirming, you can see that in Wireless Toolkits, except for WTK, Nokia Developer Suit is also listed in it!

Guess you like

Origin blog.csdn.net/cz285933169/article/details/6365000