Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7515809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:55:47+00:00 2026-05-30T00:55:47+00:00

Possible Duplicate: You must include the platform port before the LWUIT in the classpath

  • 0

Possible Duplicate:
You must include the platform port before the LWUIT in the classpath runtime exception

I am just now started the LWUIT use in J2ME. I don’t have more knowledge of LWUIT but I know better J2ME. I have added library of LWUIT in my J2ME project, it’s compiling fine but at run time it is showing below exception:

java.lang.RuntimeException: You must include the platform port before the LWUIT in the classpath
    at com.sun.lwuit.impl.ImplementationFactory.createImplementation(ImplementationFactory.java:67)
    at com.sun.lwuit.Display.init(Display.java:406)
    at HelloMidlet.<init>(HelloMidlet.java:26)
    at java.lang.Class.newInstance(), bci=0
    at com.sun.midp.main.CldcMIDletLoader.newInstance(), bci=46
    at com.sun.midp.midlet.MIDletStateHandler.createMIDlet(), bci=66
    at com.sun.midp.midlet.MIDletStateHandler.createAndRegisterMIDlet(), bci=17
    at com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=27
    at com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
    at com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
    at com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
    at com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26

How to solve this problem?

Below is my code:

import com.sun.lwuit.*;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.animations.Transition3D;
import com.sun.lwuit.events.*;
import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.io.IOException;

public class HelloMidlet extends MIDlet implements ActionListener {
    private Form form1;
    private Form form2;

    private Command cmdRotate = new Command("Rotate");
    private Command cmdSlide = new Command("Slide");
    private Command cmdExit = new Command("Exit");
        public HelloMidlet(){
            Display.init(this);
        }
  public void startApp() {
        Resources r;
        try{
            r=Resources.open("/TimelineTheme.res");
            UIManager.getInstance().setThemeProps(r.getTheme("LWUITDefault"));
        }catch (IOException e) {
            // TODO: handle exception
            e.printStackTrace();
        }
        form1 = new Form("Form 1");
        form1.setLayout(new BorderLayout());
        form1.addComponent(BorderLayout.NORTH, new Label("My First Form"));
        form1.addComponent(BorderLayout.WEST, new Label("WEST"));
        form1.addComponent(BorderLayout.CENTER, new Label("CENTER"));
        form1.addComponent(BorderLayout.EAST, new Label("EAST"));
        form1.addComponent(BorderLayout.SOUTH, new Label("Click Rotate"));
        form1.addCommand(cmdRotate);
        form1.addCommand(cmdExit);
        form1.addCommandListener(this);
        form1.setTransitionInAnimator(CommonTransitions.createSlide(
                    CommonTransitions.SLIDE_HORIZONTAL, true, 1000));

        //Setup Form 2
        form2 = new Form("Form 2");
        form2.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        form2.addComponent(0,null,new Label("This is the second Form"));
        form2.addCommand(cmdSlide);
        form2.addCommand(cmdExit);
        form2.addCommandListener(this);
        form2.setTransitionInAnimator(Transition3D.createCube(1000, true));

        form1.show();
  }

  public void pauseApp() {}

  public void destroyApp(boolean unconditional) {}

  public void actionPerformed(ActionEvent ae) {
   if (ae.getCommand()==cmdExit) {
            notifyDestroyed();
        } else if (ae.getCommand()==cmdRotate) {
            form2.show();
        } else if (ae.getCommand()==cmdSlide) {
            form1.show();
        }
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:55:50+00:00Added an answer on May 30, 2026 at 12:55 am

    Did you see that post? You must include the platform port before the LWUIT in the classpath runtime exception

    I think that this is a similar problem. Try to solve it, as suggested in the answer in above question:

    The problem was that in the UI jar I was including. LWUIT comes with 2
    “sets” of UI.jar. The generic one which is in LWUIT\UI folder and the
    platform specific ones which are in the LWUIT\Ports folder.The generic
    one is being used as “parent” project containing all the common
    code,however if you MUST import the .jar file which is for your
    platform. As readme file says:

    While these projects will compile easily they will be useless for any purpose since they don’t include the binding glue for the
    platform, to use the platform one needs to use the appropriate
    projects underneath the specific ports directory to a given platform.

    While I was recompiling the library in order to remove
    Transitions3D.java file, I recompiled (and then imported ) the generic
    UI.jar. The correct thing to do is compile, the parent project (the
    generic UI.jar) THEN compile the port specific library (in my case the
    LWUIT\ports\MIDP\UI.jar) and then import it in your project and you
    are done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Why must C# operator overloads be static? Why Static keyword before the
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: Why do I get error: … must be a reference type in
Possible Duplicate: Why must I put a semicolon at the end of class declaration
Possible Duplicate: A comprehensive regex for phone number validation Just a simple regex required
Possible Duplicate: What cross platform GUI library has the most native feel for each
Possible Duplicate: Displaying the #include hierarchy for a C++ file in Visual Studio I
Possible Duplicate: What are the benefits of using Boost.Phoenix? So I started reading the
Possible Duplicate: Why must we define both == and != in C#? Why is
Possible Duplicate: Regular expression where part of string must be number between 0-100 I'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.