A script enabled browser is required for this page to function properly.
Exit Print View

Oracle® Java Micro Edition Embedded Client Installation Guide, Version 1.0

Get PDF Book Print View
 

Document Information

1.  System Requirements

2.  Installation Procedures

3.  Working With NetBeans

Oracle Java ME Embedded Client SDK and NetBeans Projects

Adding the SDK as a Java Platform

Create and Run a New Project

Project Options

4.  Working With Eclipse

5.  Command Line Options

Chapter 3

Working With NetBeans

As mentioned in Development Environment, the recommended NetBeans version is 6.9.1. You can find this version at:

http://netbeans.org/downloads/index.html

Choose the “Java” download bundle.

This chapter details the steps to configure NetBeans to use the Oracle Java ME Embedded Client SDK as a Java platform, and presents a sample project and to run in your configured environment.

Oracle Java ME Embedded Client SDK and NetBeans Projects

This section details how to add the SDK as a Java Platform in NetBeans and how to create an Oracle Java ME Embedded Client project.

Adding the SDK as a Java Platform

Before You Begin

Oracle Java ME Embedded Client provides the Java ME platform for embedded devices, such as TV Set Top boxes and smart electric meters. These devices run a virtual machine based on Java ME CDC. To emulate this environment, the NetBeans IDE must be configured to use the Oracle Java ME Embedded Client platform. Follow these steps to install this platform into your NetBeans IDE.

This procedure was recorded on a Linux machine. If you are a PC user, use the Windows paths discussed in SDK Installation Structure.

  1. Start the NetBeans IDE.
    NetBeans Start Page with My NetBeans tab selected.
  2. Choose Tools > Plugins or go to the My NetBeans tab and click Install Plugins.
  3. Click the Installed Tab and determine if the Java ME item has a green check mark under the Active column.

    If Java ME is checked, continue to Step 9 or, if Java ME is not enabled, perform the following actions:

    1. Check the box in the Select column as shown in the following screen.
      If the Java ME plugin is not active, check the select box.
    2. Click the Activate button on the bottom left of the Plugins window.

      The NetBeans IDE Installer window opens.

    3. Click the Activate button at the bottom, as shown below.
      Click the activate button at the bottom of the NetBeans IDE Installer Window
    4. Click Finish when the Java ME plugin activation is complete.
      Click Finish to complete the plugin installation
  4. If you have an older 6.9.1 installation it must be updated to work with Oracle Java ME Embedded Client. In NetBeans, select Help > check for Updates. Repeat the update process until NetBeans reports “Your IDE is up to date.”
  5. After a successful update, NetBeans will prompt you to restart the IDE. Click the option Restart IDE now, and click Finish.
    Restart IDE Now radio button is on. Click the Finish button.
  6. Select the menu Tools->Plugins and click the Update tab.

    Click the Java box as shown, and click the Update button. This step enables the plugin for CDC Java Embedded Client Platform Implementation.


    The Java click box is enabled.
  7. After a successful update, NetBeans will again prompt you to restart the IDE. Click the option Restart IDE now, and click Finish.
    Restart IDE Now radio button is on. Click the Finish button.
  8. Click the Close button to dismiss the Plugins window.
  9. Select Tools > Java Platforms and the Java Platform Manager window opens.
    Platforms are on the left. The platform Name field and Platform folder field are populated based on the selected platform.
  10. Click the Add Platform button below the Platforms pane and the Add Java Platform window opens.
    1. On the Select platform type page, select Java ME CDC Platform Emulator.
      Select Java ME CDC platform emulator, then click Next.
    2. Click Next to display the Choose Platform Folder page.
    3. On the Choose Platform Folder page, go to the Look In field and choose or navigate to /usr/local/Oracle_JavaME_Embedded_Client/1.0/emulator-platform.
      Point to /usr/local/Oracle_JavaME_Embedded_Client/1.0 and choose Next.
    4. Click Next to display the Platform Name page.

      If no errors are displayed on the Platform Name page, click Finish and the Java Platform Manager opens.

  11. Verify that the Oracle Java Micro Edition Embedded Client is added as a CDC platform on the left and click Close.
    With Oracle Java Platform ME Embedded Client selected in the Platforms list on the left, click the Close button on the right.

    You are ready to develop applications.

Create and Run a New Project

  1. Select File > New Project and the New Project wizard opens.
  2. On the Choose Project page, complete the following:
    1. In the categories area, select Java ME.
    2. In the Projects area, select CDC Application.
      On the New Project page, choose the Java ME category and the CDC Class Library project.
    3. Click Next and the Name and Location page is displayed.
  3. On the Name and Location, perform the following actions:
    1. Enter HelloWorld for the Project Name.
    2. Select an appropriate Project Location.
    3. De-select the Create Main Class option.
    4. Click Next and the Select Platform page is displayed.
  4. On the Select Platform page, perform the following actions:
    1. Select Oracle Java Micro Edition Embedded Client Emulator from the Java Platform list.
    2. Choose JEC-1.0 from the Profile list.
      Select Oracle Java Micro Edition Embedded Client Emulator from the Java Platform list. From the Profile list choose JEC-1.0.
    3. Click the Finish button to create the new HelloWorld project (the name entered in Step 3).
  5. Create a Main class in the HelloWorld package by performing the following actions in the Projects view:
    1. Expand the HelloWorld application and the Source Packages tree.
    2. Right-click on <default package>.
    3. Select New > Java Class to open the New Java Class window.
      Right-click the default package and select New > Java Class
    4. Name the class Main, enter a lower case package name such as helloworld, and click Finish.
      Name the new class Main and enter a lower case package name. The remainder of the settings are automatically set.
  6. Edit the Main class by inserting a main method to print a string.

    For example:

    public class Main {
      public static void main(String args[]) {
        System.out.println("Hello, world!");
      }
    }
  7. In the Projects tab, right-click on the project and select the option Build.
  8. Identify helloworld.Main as the HelloWorld project main class.
    1. In the Projects tab, right-click on the HelloWorld project and select Properties to open the properties window.
    2. In the Category area, select Running.
    3. In the Main Class field, click Browse to select the Main.java file.

      The Browse Main Classes window opens with helloworld.Main selected. The option Run using main(String[] args) method execution should be selected.

    4. Click the Select Main Class button and then click OK to close the HelloWorld properties window.
  9. In the Projects tab, right-click on the project and select the option Run.

    The message, “Hello, world!” prints in the NetBeans Output window. To open the output window, select Window > Output > Output.


    Hello project Main.java file with println message showing in the Output window.

Project Options

To edit project properties, right click on the project and select the option Properties.