Intel System Studio 2019 Get Started Guide for macOS*

Create a New Java Project

Create a New Java* Project

Follow these steps to create an On-Board LED Blink or UP Squared Built-in LEDs project to update and program on a compatible target platform.

For more information about developing Java* projects; for example, taking advantage of example projects and sample code, managing connections to target platforms, and updating the middleware libraries on your target platform, see Develop Java Projects with Intel System Studio.

Note

If your project includes sample code and your board is an Intel IoT Gateway, you may need to modify the pin numbers in the example code to accommodate the pin numbering for your board. For example, when you are programming an Intel IoT Gateway and want to access pins on the Arduino 101* (branded Genuino 101* outside the U.S.) board, you must add a pin offset of 512 to the pin number. This is because the gateway uses the Arduino 101 board as a subplatform, for which 512 is the designated pin offset. To initialize pin 13 on the Arduino 101 board (the onboard LED), you would actually initialize pin 525. The same offset applies to the Up Squared* board with Grove* Pi+ shield.

Step 1: Ensure that required Java programs are installed

The steps below are required for Intel® System Studio 2019 Update 1 and earlier. For Update 2 and later, the steps are not required because AdoptOpenJDK* 11 is part of the installation.

Required for Intel® System Studio 2019 Update 1 and earlier

Make sure that AdoptOpenJDK* 11 is installed on the host system and the Oracle Java Runtime Environment* (JRE) or better is installed on the target system. For example, if your host system has Ubuntu, you can use the following steps to install the AdoptOpenJDK:

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-11-jdk

For more information, see: Installing Java 11 in Ubuntu.

Alternatively, you can choose to install the default JRE and JDK using the following steps:

sudo apt-get update
sudo apt-get install default-jre
sudo apt-get install default-jdk

Step 2: Set Maven proxy settings

If your network includes a corporate proxy, set your Maven proxy settings before creating a new Java project. For instructions, see Configuring a proxy.

Sample settings.xml file

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <proxies>
    <proxy>
      <id>central-http</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.example.com</host>
      <port>911</port>
      <nonProxyHosts>127.0.0.1|localhost</nonProxyHosts>
    </proxy>
    <proxy>
      <id>central-https</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>proxy.example.com</host>
      <port>912</port>
      <nonProxyHosts>127.0.0.1|localhost</nonProxyHosts>
    </proxy>
  </proxies>
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>
  <servers/>
  <mirrors/>
  <profiles/>
  <activeProfiles/>
</settings>

Step 3: Create and build a new project

  1. Choose File > New > Project to start the new project wizard.

  2. Expand Intel Application Development and select Java Project.

  3. Click Next.
  4. In the Code Samples list, expand Get Started and select On-Board LED Blink or UP Squared Built-in LEDs.

    The sample project name appears in the New Project Name field. If you wish to change the name, type over the displayed name.

  5. For Builder, leave Maven selected.
  6. Click Finish.

    Your project is created and displayed in the Project Explorer.

  7. In the Project Explorer, right-click the name of the project and select Build Project from the drop-down list.

    Your project should build without errors. There might be a few warnings, but they can be ignored.

Step 4: Create a new connection

CAUTION

When you connect to your target using the Eclipse Target Communication Framework (TCF), Intel System Studio copies a TCF agent to your target, which is listening for connections from any computer on your local network. Even though the IDE asks for authentication credentials, the agent does NOT have any authentication. Therefore, any user can connect to it and can use the agent to run arbitrary code on your target device.

  1. Make sure your target device is physically connected to your host system and functioning properly.

    Note

    If your target is QEMU, start the QEMU simulator in your project directory by entering the command $ runqemu qemux86-64 nographic. When prompted, run ipconfig to get the IP address.
  2. Click the arrow next to the connection box on the toolbar and select New Connection.
  3. Select Connection for container based C/C++ applications or Java applications. Click Next.
  4. Type a name in the Connection Name field.
  5. Enter the board name or IP address in the Address field. Click Finish.
  6. When prompted, provide the appropriate credentials to access your device and click OK.

Step 5: Set up credentials

Set up credentials to access the target device. You can use either of the following authentication methods:

  • Public key login

    If the application accesses hardware sensors, LEDs, or requires elevated privileges, use public key based authentication for a higher level of security. Follow the steps in SSH Connection: Password-less Access to a Remote Linux Target Device.

  • Login with password

    If the application does not require elevated privileges, you can use login with password .

Step 6: Run the application

  1. Ensure that your target connection is selected in the drop-down list.
  2. In the Project Explorer, right-click your project name, then select Run As > Remote IoT Java Maven Project.

    The Java application runs on your target. You should see the onboard LED on your target platform begin to blink.

  3. To stop the process, click the red Terminate in the console.

No mraajava in java.library.path - workaround

Follow these steps to workaround the No mraajava in java.library path error:

  1. Click the green Run button on the toolbar and select Run Configurations.
  2. In Remote IoT Java Application Configurations click your project.
  3. Select the Remote Environment tab.
  4. Click New to open the New Environment Variable.
  5. Add a variable named LD_LIBRARY_PATH with a value of /usr/lib/x86_64-linux-gnu/.

Paragraph