How to configure the eclipse development environment for j2-based systems ~

Source: Internet
Author: User

1. Download the Installation Tool

Jdk-1_5_x or jdk1.4.x
J2me_wireless_toolkit-2_2-ml-windows
Eclipse-SDK-3.1 or eclipse-SDK-3.0.x
Eclipseme. feature_0.9.2_site

2. Install JDK and configure Environment Variables

Follow the JDK prompts to install the SDK. After installation, set the environment variable.

Suppose our JDK is installed on D:/jdk-1_5_0_04

Java_home = D:/jdk-1_5_0_04 (Description: installation path)

Classpath =.; % java_home %/lib/dt. jar; % java_home %/lib/tools. Jar (Note: Set classpath to pay attention to the previous.; Do not forget :))

Add % java_home %/bin to the path (Note: To run the command, Note: If there is no semicolon after the original path, change % java_home %/bin; % java_home %/bin)

Next, we can test whether the JDK installation configuration is successful.

Compile the helloworld. Java file and enter the following code:

Class helloworld
{
Public static void main (string [] ARGs)
{
System. Out. println ("Hello world! ");
}
}

After saving the file, enter javac helloworld. Java and Java helloworld. If Hello world appears on your screen! Congratulations! Your JDK has been installed successfully!

3. Install j2me_wireless_toolkit-2_2-ml-windows (wtk)

Wtk installation is simple. Follow the prompts to install it.

4. Unzip eclipse to any location and install the call plug-in between eclipse and wtk.

5. Test j2's. Run the following code in eclipse. If Hello world! appears !, Congratulations! You have successfully installed your j2_mfa platform!

Import javax. microedition. MIDlet .*;
Import javax. microedition. lcdui .*;
Public class Hello extends MIDlet
{
Private display;
Public Hello ()
{
Display = display. getdisplay (this );
}

Public void Startapp ()
{
Form F = new form ("test ");
F. append ("Hello world! ");
Display. setcurrent (f );
}

Public void pauseapp ()
{

}

Public void destroyapp (Boolean unconditional)
{

}
}

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.