How to develop and debug Java code using JNI in TimeStorm

In TimeStorm, install Java plugin and switch to Java Perspective that will help to develop Java code using JNI (Java Native Interface). This document also shows how to create a Java Project, and develop and debug your Java application.

Install Java plugin in TimeStorm

Open TimeStorm and click on Help --> Install New Software which will open the Install Wizard as shown below.

In the install wizard, do the following:

  1. Select the appropriate eclipse version for fetching the compatible list of plugins. For example: the following screen shows a list of plugins for Neon "Neon - http://download.eclipse.org/releases/neon". Note: To find out the TimeStorm Eclipse version click on the Installation Details.
  2. Select “Eclipse Java EE Developer Tools” from the dropdown as shown below.
  3. Click on the Next button and accept the License agreement as shown below.
  4. Click on the Finish button and wait for installation. After successful installation, it will prompt you to restart TimeStorm. After restarting your ready to use Java.

How to use Java:

To use Java, you need to first switch to Java Perspective.

  1. Switch to Java Perspective:

  2. To Use Java, set the Java Perspective by Clicking on Window --> Perspective --> Open Perspective --> Other as shown below.

    It will open a list of perspectives. Select Java and click on the OK button to set the perspective as shown below.

  3. Create Java Project:

  4. In the Java Perspective, click on File --> New --> Project as shown below to open a New Project wizard.

    In the New Project wizard, click on General --> Project as shown below to Open the Project creation wizard.

    Enter Project name, Default Location, Working Sets(optional) as shown below.

    Click on the Finish button. It will create a project in the project explorer as shown below.

    The Eclipse facet allows to set the code styling for a particular program language. TimeStorm by default sets Eclipse facet to C/C++.

    To use Java, set facet to Java. Right click on the project --> Properties --> Project Facets --> Convert to Faceted Form, and select Java as shown below which will support writing applications using Java programming language as shown below.

    Then click on the Apply and OK buttons which will faceted to Java project as shown below.

    With the New Java package, New Class options which appear in the top menu. We can create Java packages and classes as shown below.

  5. Debugging Java Application with TimeStorm:

  6. To Debug the Java application, at first, place the break points. To define a breakpoint in your source code, right-click in the left margin in the Java editor and select Toggle Breakpoint. Alternatively, you can double-click on this position as shown below. Build Project (Right click on the Project → Build Project )

    Right click on the project → Debug As → Java Application. In this process, it will ask for you to switch to the Debug perspective as shown below.

    Click on the Yes button. It will switch to the debug perspective. The debug perspective offers additional views that can be used to troubleshoot an application like Breakpoints, Variables, Debug, Console etc.

    • Debug view – Visualizes call stack and provides operations on that.
    • Breakpoints view – Shows all the breakpoints.
    • Variables/Expression view – Shows the declared variables and their values. Press Ctrl+Shift+d or Ctrl+Shift+i on a selected variable or expression to show its value. You can also add a permanent watch on an expression/variable that will then be shown in the Expressions view when debugging is on.
    • Display view – Allows to Inspect the value of a variable, expression or selected text during debugging.
    • Console view – Program output is shown here.

    Stepping commands: The TimeStorm Platform helps developers debug by providing buttons in the toolbar and key binding shortcuts to control program execution.