Install s60_3rd_sdk_fp1 in windows, and build the Nokia j2_development environment on Eclipse.

Source: Internet
Author: User

Install s60_3rd_sdk_fp1 in windows, and build the Nokia j2_development environment on Eclipse.

Source code download

I recently developed s60 mobile Java and set up the SDK environment officially provided by Nokia. I found that there were a lot of problems during the build process. The author summarized the entire process of setting up the development environment of Nokia's j2_based development environment and possible problems, hoping to help more friends.
Background: Windows XP, JDK (jdk-6u13-windows-i586), wtk (wtk2.5.2), IDE (eclipse-jee-galileo-SR1-win32), eclipseme plug-in (site-1.7.9), proguard4.2 ).

We will not go into details about wtk installation configuration, eclipseme plug-in installation, and obfuscators installation. For detailed procedures, refer to the relevant blog of the author. Here we will only describe the installation of the s60 SDK and the establishment of eclipse-related environments.
Step 1,Go to Nokia to download the FP1 SDK installation package for the third edition of s60.

Ns60_jme_sdk_3rd_e_fp1.zip, 246 MB in size. Download Page: Community edition, FP 1 (240 MB.
Step 2,Install the SDK for the third edition of Nokia s60.
Decompress ns60_jme_sdk_3rd_e_fp1.zip. Double-click the setup.exe installation file after decompression. After the installation is complete, start-> All Programs-> s60 Developer Tools-> 3rd edition FP1 SDK-> MIDP-> click Run emulator. The Nokia simulator runs as follows, verify that your SDK is successfully installed.


Step 3,Download and install and configure mtj.
Mtj (mobile tools for Java) allows you to create, test, and package Nokia mobile development. The latest version of mtj1.0.1: http://www.eclipse.org/downloads/download.php? File =/DSDP/mtj/downloads/drops/R-1.0.1-200909181641/dsdp-mtj-runtime-1.0.1.zip. Size 8.45 MB (the author also uploaded a dsdp-mtj-runtime-1.0.1.zip to csdn resources ). Decompress the downloaded dsdp-mtj-runtime-1.0.1.zip to the installation root directory of Eclipse.
Step 4,Configure the Java SDK development environment in eclipse.
Start eclipse and change to an empty working directory. Choose Windows> preferences> j2e-devicemanagement and click "import... "select the root directory of the SDK you installed. For example, the author is E:/tools/s60jmesdkv3fp1/SDK/s60_3rd_midp_sdk_fp1. Click Refresh. Then, the s60emulator and s60device are recognized by eclipse, click Finish to load them. In this case, two new options are available under device management. Select s60emulator and click OK to complete environment configuration.
Step 5,Debug settings.
Window-> preferences-> j2s, debug server time-out (MS) is set to 60000; window-> preferences-> JAVA-> debug, deselect the selection of suspend execution on uncaught executions and suspend execution on compilation errors; Set debugger timeout (MS) and launch timeout (MS) to 15000, 20000, respectively. Click OK to save the settings.
Step 6,Start programming in SDK Simulator.
Create the hellos60 project with only one MIDlet. The source code is as follows:

Package COM. defonds. s60; </P> <p> Import javax. microedition. lcdui. display; <br/> Import javax. microedition. lcdui. form; <br/> Import javax. microedition. MIDlet. MIDlet; <br/> Import javax. microedition. MIDlet. midletstatechangeexception; <br/> public class helloworld extends MIDlet {<br/> display; <br/> Public helloworld () {<br/> super (); <br/> display = display. getdisplay (this); <br/>}< br/> protected Vo Id destroyapp (Boolean arg0) throws midletstatechangeexception {<br/>}< br/> protected void pauseapp () {<br/>}< br/> protected void Startapp () throws midletstatechangeexception {<br/> form = new form ("Hello s60! "); <Br/> form. append (" Hello world! "); <Br/> display. setcurrent (form); <br/>}< br/>} 
Run:


Some may have the "JAR file cocould not be initialized" warning, as shown in:


The solution is window-> preferences-> j2-> device management. Select emulator of s60 and select edit, delete [% classpath % |-classpath "% classpath %"] in the basic page of Edit s60emulator definition. Note that after deletion, eclipse must be restarted. Otherwise, the warning is returned.
Sometimes there is a "failed to initialize session" warning, as shown in:


The solution is to change to a new empty working directory and perform the operations from step 1 to Step 6.

If you have any questions, please directly communicate with the author, MSN: defonds@hotmail.com.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.