Sun Java Wireless Toolkit for CLDC

December 2008  
General Questions
Emulator Questions
Troubleshooting Questions

The installation failed during the extraction phase. I got a message that says:

Extracting the installation files...
Error! CRCs do not match! Got e61aebb2, expected f53ddfb0
Failed to extract files. Installation will stop now.

It is likely that the Java archive (JAR) utility you are using is incompatible. During the installation you are prompted for the path to the Java interpreter. You must provide the full path to a Java™ Platform, Standard Edition (Java SE SDK), version 1.5.0 installation.

The installation failed during the extraction phase. I got a message that says:

/usr/java/jre1.5.0_08/bin/jar: No such file or directory
Failed to extract files. Installation will stop now.

The JRE is not enough, you need a version 1.5.0 Java Development Kit (JDK). Install the full Java™ Platform, Standard Edition (Java SE). During installation, provide the full path to the Java SE installation.

I successfully installed on Windows 98 SE, but there are some problems.

Windows 98 SE is not a supported platform. Windows XP is the only supported platform, as stated in docs/BinaryReleasNotes.html .

Back to top

General Questions

Do I need Sun Java Wireless Toolkit Version 2.5.2_01 for CLDC?

The Sun Java Wireless Toolkit contains vulnerabilities that might allow an untrusted application to execute arbitrary code. The vulnerability can only be exploited if you obtain a malicious program and execute it in the toolkit. Although this scenario is unlikely for toolkit users, Sun Microsystems has released version 2.5.2_01 to fix the vulnerability. You can download the updated version from here, or, you can resolve to never use the toolkit to execute MIDlets from untrusted sources.

When will the Sun Java Wireless Toolkit for CLDC be supported on platforms other than Windows?

A version of the Toolkit is available today and can be downloaded here .

If this toolkit is written in Java, why is it not available on other platforms?

Although the user interface of the toolkit is written in Java SE, the product contains a substantial amount of platform-specific native code, including a full implementation of a Java ME Virtual Machine. Each platform requires a separate effort to port, test, and maintain the native code.

Can I use the Sun Java Wireless Toolkit for CLDC to develop commercial applications?

Absolutely, not only do we encourage newcomers to Java ME technology to use the WTK as an educational tool, but the WTK can also serve as an important component to the application development lifecycle for those who are developing commercial applications. Please let us know if you do, and we can showcase your application in our application developer community at Mobile and Embedded Community

When will the Sun Java Wireless Toolkit for CLDC be supported on platforms other than Windows?

It has taken longer than expected, but we intend to provide an updated version of the WTK for linux with additional supported APIs in the near future.

If this toolkit is written in Java, why is it not available on other platforms immediately?

Although the user interface of the Toolkit is written in Java SE, the product contains a substantial amount of platform-specific native code, including a full implementation of a Java ME Virtual Machine. The native code requires a separate effort to port, test and maintain for each platform.

I have updated my JDK. How do I get the emulator to use the updated JDK?

You cannot point the emulator at a different installation. You can install the new JDK in the same location as the old JDK, or, you can uninstall and re-install, supplying the path to the new JDK.

What's the fastest way to get started?

To get started using KToolbar, try opening some of the demonstration projects and running them. You can also examine and modify the source code for the demonstrations. More information is here.

Can I use the toolkit from the command line?

Yes. See Appendix B of the User's Guide for more information.

Where can I find out more about MIDP, CLDC, MMAPI, and WMA?

For more information, visit these links:

Can I build applications for MIDP 1.0 devices?

Yes, you can build applications for a wide variety of software stacks. Click the Settings... button to edit project settings, then choose the configuration, profile, and optional packages you would like on the API Selection tab.

I created a new project. Now what do I do?

The next step is to edit source code for the project. The messages in the KToolbar console tell you where to put the source code, resource files, and library files. If you're still not sure what to do, Chapter 2 of the User's Guide contains a simple example.

Where are my project's Java Application Descriptor (JAD) and Java Archive (JAR) files?

First you need to package the project by choosing Project > Package > Create Package from the KToolbar menu. The MIDlet suite descriptor and JAR file are placed in the bin directory of your project.

Can I change the directory for my project after it has been created?

Edit wtklib/Windows/ to add the following property:
kvem.apps.dir = your-new-app-directory

For full project management features, consider the NetBeans Mobility Pack.

Can I use an obfuscator?

Yes. The toolkit supports ProGuard and includes an architecture for supporting any obfuscator. See the User's Guide for more information.

Can I use a debugger?

Yes. Most likely you will use the Sun Java Wireless Toolkit for CLDC in conjunction with the debugger in an IDE. The User's Guide has more information on using a debugger.

How can I make sure that my application only uses specific APIs, for example only MIDP 2.0 APIs?

Select the API Selection tab in the Settings dialog box and select the Target Platform and APIs that you want to use.

Can I use network protocols other than HTTP and HTTPS in Java ME applications?

Yes. The MIDP 2.0 specification introduces optional support for socket, server socket, datagram, SSL, and serial (COMM) communication. The WMA specification provides support for SMS, CBS, and MMS messaging. The toolkit's support for JSR 75 and JSR 82 adds file, Bluetooth, and OBEX connections as well.

How can I test the push registry?

To observe MIDlets being launched in response to incoming network connections, you will need to run your application using the Run via OTA feature. Run via OTA simulates the process of installing an application on a device and will correctly respond to incoming network connections based on entries in the push registry. See the User's Guide for more information.

How can I access a Comm port when running on Linux?

You must set the following permission at the command line (note that you must have root privileges):

chmod a+w /dev/ttyS[01]

How can I transfer a MIDlet suite to a real device?

It depends entirely on the device. Each device manufacturer that supports MIDP must provide a mechanism for transferring MIDlets onto its devices.

Can I connect the wireless toolkit to an external bluetooth device, such as a mobile phone?

No, the wireless toolkit does not enable communications with wireless devices.

Back to top

Emulator Questions

Why does the emulator ask me if I can connect to the network?

Depending on the protection domain in which your application runs, the emulator might ask permission for certain operations including network access. For an overview of permissions and protection domains in MIDP 2.0, see Understanding MIDP 2.0's Security Architecture .

I can still use an API in the emulator even though it's not selected in the API selection project settings. What's going on?

The API selection project settings apply to building only. The emulator always supports all available APIs.

The Emulator incorrectly displays text in languages other than English. How can I change the fonts?

To display text in languages other than English, follow one of these steps:

  • Set the default locale of the desktop to the language you are trying to display.
  • Update the font configuration of the emulated device. See the Basic Customization Guide for details.

The device image displayed by the emulator is too small. How can I enlarge it?
How can I enable touch screen events in the emulator?
How can I change the set of character encoding converters available for a device?

See the Basic Customization Guide for information on modifying the default emulator.

Back to top

Troubleshooting Questions

I'm having problems deploying a demo MIDlet to a real device. What's wrong?

Some demo MIDlets are built for the MSA platform and use the MIDP 2.1 profile (check their .jad and .jar files). Many devices do not support this rather new profile. To change your project settings to match your device capabilities, click the Settings... button. In the Settings window click API Selection on the left. In the API Selection pane, choose a target platform other than MSA, and a profile other than MIDP 2.1. Select a configuration and any optional packages. Click OK.

My MIDlet won't talk to my server. What's wrong?

Make sure your server is speaking the right version of HTTP. You can adjust the version used by the emulator in the KToolbar preferences. A good way to debug network problems is to use the network monitor. See the User's Guide for details.

A connection might fail because you are behind a firewall. Go to Preferences > Network Configuration > User Proxy Server and supply your proxy information.

Why won't my device recognize my signed MIDlet suite?

Real devices on real networks might have root certificates that are specific to the manufacturer or wireless carrier. Check with your device manufacturer or wireless carrier for details on signed MIDlets.

When running my MIDlet, a security alert is displayed. Why can't I dismiss the alert?

You are probably trying to access a protected API (for example, opening a connection) from your commandAction() method, which is locking the UI thread. Access protected APIs from a separate thread. Refer to the NetworkDemo for an example on how this can be done.

When I run the emulator it crashes with one of these messages. How can I fix it?

Title: drwtsn32.exe - Unable To Locate Component
Content: This aplication has failed to start because dbgeng.dll was not found.
Re-installing the application may fix this problem.

Error: Can not find soundbank path in registry.

Your Windows installation is missing one or more of the following files:


Copy the missing files from a standard Windows installation to the problem installation and restart.

I'm using an application that connects to the internet and I get an error code. Do I need to change the settings in the toolkit?

Yes. Select Preferences > Network > Proxy Server and specify your proxy information.

JSR172Demo calls but that server does not respond. Is there another server I can use?

Yes. JSR172Demo uses

Why do I get Error loading class... messages when running the preverifier?

First, check that your Java sources and libraries can be used with CLDC and MIDP APIs.

Then, ensure that you installed the Sun Java Wireless Toolkit for CLDC in a directory whose path does not contain any spaces. For example, the toolkit does not work with the path C:\Program Files\WTK25.

If you installed the toolkit in a directory whose path contains spaces, you must uninstall the toolkit and reinstall it in a directory whose path name does not contain any spaces.

I want to use an external library, but when I try to build a MIDlet suite that uses it, I get " Error preverifying class..." messages. Why does this happen?

If you get this error, you are probably using a class library that was written for Java 2 Platform, Standard Edition (J2SE™ platform). This toolkit supports the development of MIDP applications, which have limited capabilities compared to their J2SE counterparts.

I created an application that uses a third party library. There are no compilation or preverification problems, but I get the following error message. How can I fix this?

Uncaught exception java/lang/NoClassDefFoundError: java/awt/Frame: Cannot create class in system package.

To use 3rd party libraries see Project > Properties > External APIs and see the User's Guide. Note, you can't create classes in system packages (for example, java, javax., com.sun.) because of security restrictions.

I wrote an application to send SMS messages and it fails with *Type not supported*.

You should pass MessageConnection.TEXT_MESSAGE and add the payload like this:

smsconn = (MessageConnection);

TextMessage txtmessage = (TextMessage)smsconn.newMessage(

Please, see the SMSDemo example for a complete code example.

Why do I have font display problems when I run the multi-language version using Asian locales on Ubuntu?

Sun JDK and JDK downloads (from here) do not include font configuration files for Ubuntu. To obtain the font configuration files, use the Ubuntu package manager to install Sun Java packages for Ubuntu (select sun-java6-jdk). Refer to the following document for further information:

I have another question, and I can't find the answer here.

Try the developer forum, or send us feedback from

Back to top

Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
Java 8 banner (182)