How to Use lwuit in eclipse

Source: Internet
Author: User
Tags subversion client svn client netbeans

The following is the process of using lwuit on eclipse by a foreign user. (There are a lot of notes. I think it's still convenient to use sun's netbean)

Hello all

If you are an eclipse developer like me, than you are probably missing
The possibility to build lwuit with eclipse. This small how-to describes
What I did to get this done:

What you need

A. Love to work with eclipse

B. A Subversion client (I use tortoisesvn) and some subversion know-how

C. A good Internet connection

Setup eclipse and create a new MIDlet Project

1. Install the eclipse mjt plugin (http://www.eclipse.org/dsdp/mtj/
) And set it up correctly (http://www.eclipse.org/dsdp/mtj/.../gettingstarted. php
)

2. Create a new "MIDlet Project"

3. Open the "Application descriptor" file and change the "microedition profile" from version 2.1 to 2.0

Checkout lwuit

4. Open a file explorer and navigate to the new project in your eclipse
Workspace (you can see where this is in the Project Properties
(Alt-Enter) on the "resource"-Tab)

5. Checkout the lwuit directory with the URL
"Https://lwuit.dev.java.net/svn/lwuit/trunk/MIDP/LWUIT" (guest/guest)
Directly into your project directory with your SVN Client

Fix compilation errors

6. Go back to eclipse and refresh (F5) Your project: Now there "src"
Folder shocould show some "com. Sun. lwuit" folders and also (unfortunately)
Some compiling errors

7. To fix the compiling errors (maybe if someone of the developer team
Reads this, he can fix this directly in the repository), open
Erroneous classes and put a "this." in front of every expression marked
As error ("setlayout..."-> "This. setlayout ...")

Download necessary build files

8. Now comes the circumstantially part. You have to download netbeans!
Yes, I'm afraid so. All you need is a jar file with about 200 K, that's
Inside the netbeans distribution. But I don't want to post it here,
Because I am not sure if this offend against any sun licenses.

9. After you downloaded and installed netbeans, create a "lib" Directory
Inside your project. Then copy
"Org-netbeans-modules-mobility-antext.jar" from
"Netbeans_installation/mobility8/modules" Directory into your new "lib"
Directory.

Fix the build for eclipse

10. Open "nbproject/build-impl.xml" and delete "$ {netbeans. User}/" in line 7. The line shoshould now appear:

<Property name = "user. properties. File" location = "build. properties"/>

(I know, that this file shocould not be edited (see line 2), maybe someone has a better idea here)

10. Create a new "build. properties" file right under the project (next
To "build. xml") with your settings for the build. You need at least this
Three entries here:

* "Project. lwuit" = the path to the lwuit project (in our case this is ".")

* "Libs. j2me_ant_ext.classpath" = the path to the netbeans lib (in our
Case this is now "lib/org-netbeans-modules-mobility-antext.jar ")

* "Platform. Home" = the path to your wtk (this depends on your wtk installation)

My "build. properties" looks like this:

Project. lwuit =.

Libs. j2me_ant_ext.classpath = lib/org-netbeans-modules-mobility-antext.jar.

Platform. Home = C: // wtk2.5.2

These are the minimum entries for the "build. properties" file. If someone finds more useful settings, please post it here.

Run the build

Now everything shoshould be ready to run the build. Right-click on
"Build. xml" and say "run as/ant build". The build shocould finish
Successfully and you shoshould find the resulting "lwuit. Jar" in the "Dist"
Directory of the project.

I hope I can make some eclipse developers happy with this how-to. Any comments are welcome.

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.