2 Setting Up the Development Environment

Before you can start developing Java ME Embedded applications, set up the development environment.

System Requirements

There are no hardware limitations for installing and running Oracle Java ME SDK as long as all software requirements are met.

The following table lists the software requirements for installing Oracle Java ME SDK 8.3.


Table 2-1 Software Requirements for Oracle Java ME SDK 8.3

Component Requirement

Operating System

Microsoft Windows 7 or Windows 10 64-bit

Linux/x86, for example Ubuntu 15.10 Unity 64 bit

Java Platform

Java Platform, Standard Edition (Java SE) Development Kit version 8 with the latest updates

Integrated Development Environment

  • NetBeans IDE 8.1 or later is required if you want to install the Oracle Java ME SDK plug-ins for NetBeans IDE

  • Eclipse IDE 4.5 or later is required if you want to install the Oracle Java ME SDK plug-ins for Eclipse IDE


Removing Previous Versions of Java ME SDK

It is possible to run several instances of Java ME SDK, but you may want to remove previous versions when installing a new one.

Tip:

Before removing Java ME SDK, copy any related data that you want to save to a separate folder.

  1. Stop the Device Manager as follows:
    • Right-click the Device Manager icon in the system tray, and select Exit.

  2. Run the Java ME SDK Installation Wizard in any one of the following ways:
    • Open the Java ME SDK installation directory and run remove.exe for Windows, remove.sh for Linux.

    • On Windows, open the Windows Start menu, select All Programs, then open the Java ME SDK folder, and click Uninstall.

    • On Windows, open the Windows Start menu, select Control Panel, then Programs, then Programs and Features, then select Java ME SDK in the list and click Uninstall.

  3. On the first step of the wizard, click Yes to confirm that you want to uninstall Java ME SDK. Then follow the steps of the wizard.

Installing the Java SE Development Kit

The Java Platform, Standard Edition (Java SE) Development Kit (JDK) includes a complete Java Runtime Environment (JRE) and tools for developing, debugging, and monitoring Java applications. As an implementation of the Java SE platform, the JDK is required for alignment of Java ME Embedded features and APIs through a unified development model.

Oracle Java ME SDK 8.3 requires JDK 8 with the latest updates.

To install the JDK:

  1. Download the JDK installer from the Java SE Downloads page at

    http://www.oracle.com/technetwork/java/javase/downloads

    Note:

    You must accept the Oracle Technology Network (OTN) License Agreement to download this software.

  2. Double-click the executable file and follow the steps of the JDK Installation Wizard.

For information about installing the JDK, refer to the Java Platform, Standard Edition Installation Guide at

http://docs.oracle.com/javase/8/docs/technotes/guides/install

Installing Oracle Java ME SDK

The base Oracle Java ME SDK 8.3 package includes a set of tools for developing Java ME Embedded applications, and the Java ME Embedded 8.3 runtime as a device emulation environment for Windows and Linux.

Tip:

Before installingOracle Java ME SDK 8.3, you may want to remove any previous versions. For more information about removing previous versions of Java ME SDK, see Removing Previous Versions of Java ME SDK.

Installing Oracle Java ME SDK on Windows

To install Oracle Java ME SDK 8.3:

  1. Make sure that JDK 8 with the latest updates is installed.

    For more information about how to find the version of Java installed, see the Java Help Center article at

    https://www.java.com/en/download/help/version_manual.xml

    For more information about installing the JDK, see Installing the Java SE Development Kit.

  2. Download the Oracle Java ME SDK 8.3 installer as an executable file at

    http://www.oracle.com/technetwork/java/javame/javamobile/download/sdk

    Note:

    You must accept the Oracle Technology Network (OTN) License Agreement to download this software.

  3. Double-click the executable file and follow the steps of the Java ME SDK Installation Wizard.

Installing Oracle Java ME SDK on Linux

To install Oracle Java ME SDK 8.3:

  1. Make sure that JDK 8 with the latest updates is installed.

    For more information about how to find the version of Java installed, see the Java Help Center article at

    https://www.java.com/en/download/help/version_manual.xml

    For more information about installing the JDK, see Installing the Java SE Development Kit.

  2. Download the Oracle Java ME SDK 8.3 installer as a Shell script file at

    http://www.oracle.com/technetwork/java/javame/javamobile/download/sdk

    Note:

    You must accept the Oracle Technology Network (OTN) License Agreement to download this software.

  3. Change to the directory where you saved the script, set the execution permission, and run it from the command line as follows:

    ./oracle-jmesdk-8-3-rr-linux-bin.sh

  4. Follow the steps of the Java ME SDK Installation Wizard.

Installing 32-bit Support Libraries on 64-bit Linux

Because Oracle Java ME runtime is a 32-bit application that cannot be easily ported to a 64-bit architecture, you need to manually install 32-bit support libraries on a 64-bit Linux machine for starting Java ME SDK.

E.g., to install 32-bit support libraries on Ubuntu 15.10, perform the following commands:

  1. sudo dpkg --add-architecture i386
  2. sudo apt-get update
  3. sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
  4. Reboot the machine.

Enabling Access to Serial Ports on Linux

If you want to work with UART using Device I/O APIs, with COM ports via Generic Connection framework, or connect boards to Java ME SDK via USB/COM interface, you need to run Java ME SDK under the user that has permissions to access serial ports.

To grant the user access to serial ports, add the user to the corresponding group (e.g., on Ubuntu 15.10, add the user to dialout group.)

Installing NetBeans IDE

NetBeans IDE is a free and open source integrated development environment (IDE) that facilitates the development of Java applications. Oracle Java ME SDK plug-ins for NetBeans IDE enable all features to be used from within the IDE.

NetBeans IDE 8.1 or later is required if you want to use the Oracle Java ME SDK plug-ins.

To install NetBeans IDE 8.1:

  1. Download the NetBeans IDE 8.1 installer from the downloads page at

    https://netbeans.org/downloads/

    There are several installers available, depending on the bundle that you need. The Java ME tools pack is included in the full download option, so you should download the installer under the All column.

  2. Double-click the executable file and follow the steps of the NetBeans IDE Installer Wizard.

After you install NetBeans IDE, start it and check for updates. If updates are available, a corresponding indicator will be available in the status bar at the bottom right of the main window. To start the check manually, open the Help menu and select Check for Updates.

For detailed information about installing NetBeans IDE, refer to the installation instructions page at

https://netbeans.org/community/releases/80/install.html

Installing the Java ME SDK Plug-ins for NetBeans IDE

Plug-ins for NetBeans IDE enable all features of Oracle Java ME SDK to be used from within the IDE.

Oracle Java ME SDK 8.3 provides the following plug-ins for working with NetBeans IDE 8.1:

  • Java ME SDK Tools: Integrates the Oracle Java ME SDK tools into the IDE.

  • Java ME SDK Demos: Provides demo Java ME Embedded applications.

The Oracle Java ME SDK plug-ins for NetBeans IDE are distributed as NetBeans module (NBM) files in a ZIP archive. The NBM files are recognized by the NetBeans Plugin Manager. You can configure the Plugin Manager to automatically install the plug-ins by pointing it to the updates.xml file that is available in the archive.

To install the Oracle Java ME SDK plug-ins for NetBeans IDE:

  1. Download the ZIP archive with the Java ME SDK plug-ins at

    http://www.oracle.com/technetwork/java/javame/javamobile/download/sdk

    Note:

    You must accept the Oracle Technology Network (OTN) License Agreement to download this software.

  2. Extract the ZIP archive with the plug-ins to a directory on your computer.

  3. Start NetBeans IDE, open the Tools menu, and select Plugins.

  4. If you have a previous version of the Java ME SDK plug-ins installed, remove them as follows:

    1. On the Installed tab, select Show Details (if available), then select Java ME SDK Tools and Java ME SDK Demos in the list, and click Uninstall.

    2. Follow the steps in the NetBeans IDE Installer Wizard. On the last step of the wizard, select to restart NetBeans IDE now, and click Finish.

  5. When NetBeans IDE restarts, open the Tools menu, select Plugins, and add an update center for Java ME SDK plug-ins as follows:

    1. On the Settings tab, click Add.

    2. In the Name field, enter Java ME SDK Plug-ins Update Center.

    3. Select Check for updates automatically.

    4. In the URL field, use the file uniform resource locator (URL) scheme to point to the location where you extracted the Java ME SDK plug-ins, for example:

      file:///C:/My_Update_Center_Plugins/updates.xml
      
    5. Click OK.

    6. Ensure that the Java ME SDK Plug-ins Update Center is active by selecting the corresponding check box in the list on the Settings tab.

  6. Install the Java ME SDK plug-ins as follows:

    1. On the Available Plugins tab, select Java ME SDK Tools and Java ME SDK Demos in the list, and click Install. The two plug-ins are in the Java ME SDK Tools category.

    2. Follow the steps in the NetBeans IDE Installer Wizard. On the last step of the wizard, select to restart NetBeans IDE now, and click Finish.

    Note:

    If the Java ME SDK plug-ins are not in the list on the Available Plugins tab, it is likely that you specified the wrong URL to the updates.xml file in the update center.

    If you are not able to get the Plugins Manager to recognize the Java ME SDK plug-ins, install them manually. To install the plug-ins manually:

    1. On the Downloaded tab, click Add Plugins.

    2. Browse to the directory where you extracted the archive with the Java ME SDK plug-ins, select all NBM files and click Open.

    3. Follow the steps of the NetBeans IDE Installer Wizard. On the last step of the wizard, select to restart NetBeans IDE now, and click Finish.

  7. When NetBeans IDE restarts, open the Tools menu, select Plugins, and verify that the Java ME SDK plug-ins are active as follows:

    1. On the Installed tab, select Show Details (if available), then find the Java ME SDK Tools and Java ME SDK Demos plug-ins in the list. If they are not active, then select them and click Activate.

    2. When the Java ME SDK plug-ins are active, click Close to close the Plugins window.

If the plug-ins were installed successfully, the Java ME SDK Start Page tab should be open in NetBeans IDE. To view this tab, select Java ME SDK Start Page on the Help menu.

Installing Eclipse IDE

Eclipse IDE is a free and open source integrated development environment (IDE) that facilitates the development of Java applications. Oracle Java ME SDK plug-ins for Eclipse IDE enable all features to be used from within the IDE.

Eclipse IDE 4.5 or later is required if you want to use the Oracle Java ME SDK plug-ins.

To install Eclipse IDE 4.5:

  1. Download the ZIP file (tar.gz for Linux) with the Eclipse IDE 4.5 package from the downloads page at

    https://www.eclipse.org/downloads/

    There are several packages available, depending on the bundle that you need. Eclipse IDE for Java Developers package should be sufficient to develop Java ME applications.

  2. Extract the downloaded ZIP file to a directory of your choice (for example, on Windows, C:\Eclipse, on Linux /home/<user name>/eclipse). On Windows, you can optionally create a shortcut to the executable file (eclipse.exe) in this directory.

For detailed information about installing Eclipse IDE, refer to the installation instructions page at

https://wiki.eclipse.org/Eclipse/Installation

Installing the Java ME SDK Plug-ins for Eclipse IDE

Plug-ins for Eclipse IDE enable all features of Oracle Java ME SDK to be used from within the IDE.

Oracle Java ME SDK 8.3 provides the following plug-ins for working with Eclipse IDE 4.5:

  • Java ME SDK Tools: Integrates the Oracle Java ME SDK tools into the IDE.

  • Java ME SDK Demos: Provides demo Java ME Embedded applications.

Note that to use the Java ME SDK plug-ins, you must run Eclipse IDE on top on GTK2 rather than the default GTK3.

The Java ME SDK plug-ins are distributed as JAR files archived inside a ZIP file. The JAR files contain platform extensions for Eclipse IDE that are recognized by the Install New Software Wizard.

In order to install the Java ME SDK plug-ins, you need the Mobile Tools for Java (MTJ) extensions. They are also distributed as JAR files, but in a separate ZIP file. When you install the Java ME SDK plug-ins, MTJ extensions should install automatically. However, you can download and install them separately. For more information, see Installing Mobile Tools for Java Extensions.

To install the Java ME SDK plug-ins for Eclipse IDE:

  1. Download the ZIP files with the Java ME SDK plug-ins from

    http://www.oracle.com/technetwork/java/javame/javamobile/download/sdk

    Note:

    You must accept the Oracle Technology Network (OTN) License Agreement to download this software.

  2. Start Eclipse IDE and uninstall the previous versions of Java ME SDK plug-ins as follows:

    1. Open the Help menu and click Installation Details.

    2. On the Installed Software tab, select Java ME SDK Tools, and Java ME SDK Demos in the list, and click Uninstall.

    3. On the Uninstall Details window, click Finish.

    4. When prompted, click Yes to restart Eclipse IDE.

  3. Install the Java ME SDK plug-ins as follows:

    1. Open the Help menu and select Install New Software.

    2. At the top of the Available Software window, click Add.

    3. In the Add Repository dialog, click Archive.

    4. In the file-system explorer window, browse to the ZIP file with the Java ME SDK plug-ins and click Open.

    5. In the Add Repository dialog, click OK.

    6. On the Available Software window, select Java ME SDK Tools and Java ME SDK Demos in the list, and click Next.

    7. On the Install Details window, click Next.

    8. Accept the terms of the license agreement and click Finish.

    9. When the installation process completes, restart Eclipse IDE.

When you start Eclipse IDE, to develop Java ME Embedded applications, activate the Java ME perspective as follows:

  1. Open the Window menu, select Perspective, select Open Perspective, then Other.

  2. In the Open Perspective window, select Java ME and click OK.

To use the Java ME SDK plug-ins for Eclipse IDE on Linux platform, you must install the WebKit engine for GTK+. The version of the WebKit must be compatible with the GTK+ library used to render Eclipse IDE.

E.g., on Ubuntu 15.10, download WebKit 1.0-0 and perform the following command:

sudo apt-get install libwebkitgtk-1.0-0

Note that only Eclipse rendered by GTK2 is currently supported. To enable running Eclipse IDE on top of GTK2, set the SWT_GTK3 environment variable to 0.

E.g., on Ubuntu 15.10, use the following command:

export SWT_GTK3=0

Installing Mobile Tools for Java Extensions

When you install the Java ME SDK plug-ins, Mobile Tools for Java (MTJ) extensions should install automatically. However, you can download and install them separately as follows:

  1. Download the ZIP file with the MTJ 2.0.1 extensions from

    http://www.eclipse.org/mtj/

  2. Start Eclipse IDE and uninstall the previous versions of MTJ extensions as follows:

    1. Open the Help menu and click Installation Details.

    2. On the Installed Software tab, select Mobile Tools for Java, and click Uninstall.

    3. On the Uninstall Details window, click Finish.

    4. When prompted, click Yes to restart Eclipse IDE.

  3. Install the MTJ plug-ins as follows:

    1. Open the Help menu and select Install New Software.

    2. At the top of the Available Software window, click Add.

    3. In the Add Repository dialog, click Archive.

    4. In the file-system explorer window, browse to the ZIP file with the MTJ plug-ins and click Open.

    5. In the Add Repository dialog, click OK.

    6. On the Available Software window, select Mobile Tools for Java in the list, and click Next.

    7. On the Install Details window, click Next.

    8. Accept the terms of the license agreement and click Finish.

    9. When the installation process completes, restart Eclipse IDE.

Installing JavaCard Emulator

Oracle Java ME SDK supports JSR 177 Security and Trust Services APIs. If you want to work with the APDU emulation, you must download and install JavaCard SDK 2.2.1 from

http://www.oracle.com/technetwork/java/embedded/javacard/downloads/index.html

You need only JavaCard emulator (cref.exe) to enable APDU emulation in Java ME SDK 8.3.

Updating Oracle Java ME SDK

Oracle Java ME SDK is constantly being developed. New releases may include new features, support for new APIs, fixes of known issues, and so on. You should always use the latest available version of Oracle Java ME SDK.

For minor releases, it is possible to update your instance of Oracle Java ME SDK. However, in case of a major release, you have to install the new version of Oracle Java ME SDK.

The Java ME SDK Update Center provides notifications when updates to the core Oracle Java ME SDK components, tools, or the Java ME Embedded runtime become available. This ensures that developers are working with the latest version of Oracle Java ME SDK.

Starting the Java ME SDK Update Center

The Java ME SDK Update Center is a standalone tool, but it can also be started from the NetBeans IDE or Eclipse IDE if you have the Java ME SDK plug-ins installed.

To start the standalone Java ME SDK Update Center:

  • Launch update-center.exe for Windows (update-center for Linux) under bin in the Oracle Java ME SDK installation directory.

To start the Java ME SDK Update Center from NetBeans IDE:

  • Open the Tools menu, select Java ME, and then Java ME SDK Update Center.

To start the Java ME SDK Update Center from Eclipse IDE, you need to be in a Java ME Perspective.

  • Open the Help menu and select Java ME SDK Update Center.

The Java ME SDK Update Center Window

The Java ME SDK Update Center window is separated into the following tabs:

  • Available: Contains a list of Java ME SDK packages available on the update server that you can install.

  • Installed: Contains a list of installed Java ME SDK packages that you can uninstall.

  • Updates: Contains a list of installed Java ME SDK packages for which updates are available on the update server.

  • Settings: Contains a list of update servers that you can customize.

    Note:

    You cannot remove or edit the default Java ME SDK Update Server.