javax.microedition.lcdui does not exist - java-me

I am trying to learn j2me so I try a simple j2me app at netbeans but code can not find javax.microedition.lcdui package.I have install Java 1.8 with J2ME
The project at netbeans has cldc 1.8 and MEEP 8.
The code can find javax.microedition.midlet, lcdui does not exist anymore?

i had this problem too. The reason is because java me sdk uses micro edition and embedded profile(meep) and the lcdui class is a part of midp. Any app created on an meep profile using lcdui class is denied by the compiler. The possible solution is downloading the wtk. It includes the midp profile and lcdui class

Related

Javame sdk 8.3 doesn't work on Netbeans

I've faced a problem with configuring Netbeans 8.1 to develop javame application with Javame SDK 8.3. When a javame project is created, Platform property remains grayed, compilation produced the message:
Platform home (platform.home property) is not set. Platform home (platform.home property) is not set. Value of this property should be <space> emulator home directory location.
When I try to fix project property on the platform tab, I see that:
No CLDC platform available
An old Javame SDK 3.4 works.
Any ideas could be helpful.
The confusion comes from the fact that JavaME is so much more than just MIDP/CLDC. It is used for so many other things, like e.g. Blu-ray players and other embedded devices.
MIDP and CLDC are merely JSR API's - which for some reason has been excluded from the SDK 8.x versions. This is why it can't find a CLDC platform, unless you install SDK 3.4
No other way around it than to use SDK 3.4
MIDP2.0 = JSR118
CLDC1.1 = JSR139
No where to be found in the list of SDK 8.x supported APIs: http://docs.oracle.com/javame/8.3/javame-apis.htm

Where did lcdui go, in JME SDK 3.0+?

I want to write a tiny "hello world" J2ME MIDlet. In a sample like this one, classes in javax.microedition.lcdui.* are used for display output. When I try to compile it in Eclipse, I get the error,
The import javax.microedition.lcdui cannot be resolved
I've installed JME SDK 3.4, and I'm able to run MIDlets that don't import javax.microedition.lcdui.*. I read somewhere that lcdui can be obtained from the wireless toolkit; and Oracle says that the wireless toolkit has been integrated into JME SDK as of 3.0+.
So why can't Eclipse find it?
OK, I think I know the answer now.
I got back to the JME SDK 3.4 documentation page on Using Sample projects, and created and ran an instance of UIDemo. It uses lcdui classes, but it runs flawlessly - no errors about inability to resolve javax.microedition.lcdui.*.
The difference appears to be that the working sample uses different libraries than the one I tried at first. The first one uses org.elipse.mtj.JavaMEContainer/Oracle Java(TM) Platform Micro Edition SDK 3.4/IMPNGDevice1,
while the one that works uses org.elipse.mtj.JavaMEContainer/Oracle Java(TM) Platform Micro Edition SDK 3.4/JavaMEPhone1. They contain different sets of jars, e.g. the working one contains midp_2.1.jar, while the earlier one has impng_1.0.jar.
A follow-up question might be, why doesn't IMP-NG have lcdui in it? Well, those who pay attention to what they're doing will have read that
This JSR [for IMP-NG] will define a J2ME profile targeting embedded networked devices that wish to support a Java runtime environment similar to the Mobile Information Device Profile (MIDP) version 2.0, but that do not provide the graphical display capabilities required by MIDP 2.0.
The Information Module Profile - Next Generation (IMP-NG) will be a strict subset of MIDP 2.0, where at least the APIs relating to GUI functionality (the LCDUI) are removed. Functionality not already present in MIDP 2.0 is not anticipated or desired. "
The next question might be, why did I end up selecting IMP-NG when I was going through the tutorial... when I really do want a MIDlet that does something graphically? But I'm not sure I care, now that it's working.
The new me sdk 8.2, as I understood after browsing all class and in packages, does not provides any class to develop user interface. not like sdk 3.4, that have many graphical components.

javafx.scene.control.Pagination not found

I'm using java 1.7_07 which include javafx 2.2.1.
When I try to import the package javafx.scene.control.Pagination Netbeans doesn't find it. The class is present in the API documentation, I can't see the reason.
Check your javafx version: How to get the version number of JavaFX?
You may use Java Platform in NetBeans settings being setup to older JavaFX and Pagination is a relatively new control.

How to make a executable file of JavaFX 2.0 project?

I want to make a executable file of my project which I made in JavaFX 2.0. Can anyone help me with this?
The JavaFX team implemented support for this in the tools bundled with the JavaFX 2.2 SDK (included in Java7 from update 6). The JavaFX packaging toolset for packaging executables is documented in self-contained application section of the JavaFX deployment guide.
See RT-19446 "Add ability to co-bundle Java + JavaFX + App into a single native executable" for more information (anybody can sign up to view the jira).
3rd party tools such as the JavaFX maven plugin or the JavaFX gradle plugin, streamline integration of building native JavaFX executables using common build systems.
The JavaFX packaging tools can also be used to natively package any Java application, not just JavaFX applications. For example, a Swing application, as demonstrated by this shell script for packaging a Swing application using JavaFX on OS X.
If you want to do the packaging for the 2.0 or 2.1 versions of JavaFX (not JavaFX 2.2+), then you should review Packaging JavaFX Applications as Native Installers.
Javafx 2+ can now easily be packaged as a native exe (with an added payload, which the current JRE), the up to date (as in the end of 2012) article is here: http://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm
Out of curiosity I created an executable on Windows (copy-pasting the netbeans build code into netbeans' build.xml) from the canvas and the hello world examples: the app is around 20k, the executable/launcher is around 80k and the added runtime is 138mb.
By the way if you have an older netbeans install (installed with a pre 1.7jdk) you may have to update it or edit its netbeans.conf fixing the "netbeans_jdkhome" path, otherwise the bundled executable's packaging may fail.
There are several tools to generate a customized exe launcher for your Java application.
I have good experience with Winrun4J: http://winrun4j.sourceforge.net/
but you will always need an installed Java/JavaFX Runtime even if you have an .exe that contains all your code.

Is this possible to use LWUIT in sun java wireless toolkit 2.5.2 midp2.0?

please let me know whether it is possible or not? if yes give me the procedure to setup and run the application.
You can easily use LWUIT with java wireless toolkit. You can use LWUIT 1.4 jar file. If you want to latest source code, checkout here... Use netbeans, build the LWUIT project and get latest LWUIT jar file. Netbeans already having sun java wireless toolkit 2.5.2. In eclipse you need to add the plugin for this. and use the LWUIT jar file for your application.
LWUIT is a framework.That builds upon j2me.Better u refer the oracle site for further information.

Resources