Set Up Your Development Environment to Use the Java SE Client Software Libraries

Before you can develop applications that let your devices to communicate with Oracle Internet of Things Cloud Service, you first download, install, and configure the Java SE client software libraries.

  1. Ensure that the time in your system is current. If the date and time must be adjusted, do the following:
    1. For the Windows 7 and 8 platform, click the time and date in the lower right corner of the desktop. When the resulting popup window opens, select Change Date and Time Settings... at the bottom. Use the Date and Time dialog, shown below, to reset the date and time.
    2. For the Windows 10 platform, right click the time and date in the lower right corner of the desktop, and select Adjust Date and Time from the popup menu. Use the Time and Language settings panel, shown below, to reset the date and time.
    3. For the Mac platform, select System Preferences... from the Apple menu in the upper left corner of the desktop, then choose Date and Time. Reset the date and time accordingly.
    4. For the Linux platform, open a command prompt and use the date command, such as the following:
      date -s "19 APR 2017 11:14:00"
  2. Download and install Gradle. Instructions on installation for various platforms can be found on the Gradle website.
  3. Open a web browser and browse to the Oracle Internet of Things Cloud Service client software libraries download site.
  4. Scroll to Java SE Client Software Library and download the Binaries, Source Code and Samples zip files from the Java SE Client Software Library table. This table describes the contents of each zip file:
    Filename Description
    iotcs-csl-javase-bin-<version>.zip

    Contains the Java SE client software library binary files.

    iotcs-csl-javase-src-<version>.zip

    Contains the Java SE client software library binary file source code.

    iotcs-csl-javase-samples-<version>.zip

    Contains the Java SE sample applications.

  5. Extract the contents of the zip files. The files are saved to these directories:
    Filename Directory
    iotcs-csl-javase-bin-<version>.zip iotcs/csl/javase/bin
    iotcs-csl-javase-src-<version>.zip iotcs/csl/javase/src
    iotcs-csl-javase-samples-<version>.zip iotcs/csl/javase/samples
  6. Set the CL_HOME, GRADLE_HOME, and, JAVA_HOME environment variables to their appropriate values. Sample values for the Linux platform are listed in the following table.
    System Variable Name Example
    CL_HOME /home/<user>/iotcs/csl/javase/
    GRADLE_HOME /opt/gradle-<version>
    JAVA_HOME /usr/java/jdk<version>
    1. For the Windows 7 platform, open the Control Panel and select System. Then, choose Advanced System Settings in the upper left of the dialog. In the System Properties dialog, choose the Advanced tab, then press the Environment Variables button. Add the new environment variables to either the user or system section.
    2. For the Windows 10 platform, open Settings and select System. Then, select the About tab on the left side, and choose Advanced System Settings in the upper right of the dialog. In the System Properties dialog, choose the Advanced tab, then press the Environment Variables button. Add the new environment variables to either the user or system section.
    3. For the Mac platform, create or edit the file ~/.bash_profile and add one line for each entry, such as the following examples:
      export CL_HOME=~/iotcs/csl/javase/
      export GRADLE_HOME=/opt/local/share/java/gradle
      export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
    4. For the Linux platform, create or edit the file ~/.profile (or equivalent for the command line shell) and add one for each entry, as in the Mac example.
  7. Modify the PATH variable to include the path to the Java and Gradle executables. Use the instructions for each platform in the previous step to access the environment variables for each operating system.
    For example, in the Linux environment, you can add the following to the existing PATH variable.
    export PATH=$JAVA_HOME/bin:$GRADLE_HOME/bin:$PATH
  8. If your computer is on a Virtual Private Network, or behind a firewall:
    1. Open the gradle.properties file, located in the Gradle user home directory and add these lines:
      systemProp.http.proxyHost=<your_proxy_server.com>
      systemProp.http.proxyPort=<your_proxy_port>
      systemProp.https.proxyHost=<your_proxy_server.com>
      systemProp.https.proxyPort=<your_proxy_port>
    2. Save your changes and close the gradle.properties file.
  9. Start your favorite IDE and install the Gradle Support plugin.
  10. Register your device, record the password, and download the provisioning file. See Registering and Activating Devices.
  11. Using the web interface, create a new application named JavaSECLApp. See Creating a New Application.
  12. Associate the humidity and temperature sensor device models with the JavaSECLApp application. See Assign a Device Model to a Cloud Service.
  13. Add an integration named JavaSECLApp to the application. See Integrating Enterprise Applications with Oracle IoT Cloud Service.
  14. Download the provisioning file for the integration:
    1. Log in to your Oracle Internet of Things Cloud Service instance.
    2. Click the Menu (Menu icon) icon adjacent to the Oracle Internet of Things Cloud Service title on the Management Console.
    3. Click Applications and then Browse Applications.
    4. Click JavaSECLApp and then Integration.
    5. Select the JavaSECLApp integration and click the Edit (Edit icon) icon.
    6. Click the Overview tab.
      If you are using Oracle Internet of Things Cloud Service version 16 4.1 or earlier, record the ID and Shared Secret values. These values are required when you run the provisioning tool to create the trusted assets store .
    7. Enter a password in the File Protection Password field to encrypt the provisioning file that contains the configuration and credentials to activate your integration.
    8. Enter the password again in the Confirm Password field.
    9. Click Download Provisioning File.
    10. Click Save File.
    11. Browse to a directory and then click Save.
  15. Prepare your device for the installation of the Java SE client software libraries. See Prepare an Embedded Device to Use the Java SE Client Software Library.
  16. Run the Java SE client software library sample applications. See Create the Java SE Client Software Library Sample Applications.