
This article shows how to set up your IDE so that you can debug (run, hit breakpoints, single step, examine variables) your KOS backend Java code.
While these specific instructions are for IntelliJ and Eclipse, you can follow these same general steps if you use another IDE.
KOS gives you the ability to debug your Java code. It works whether the target system is a simulator or actual hardware.
The primary component, the "KOS Debug JRE", sits between your IDE, your running KOS Studio, and the target system.
The following diagram illustrates the interactions that occur during the debug process:
The rest of this article explains how you set up and use the KOS Debug JRE.
Follow these steps when using the IntelliJ IDE. The instructions are basically the same for Linux, Mac, and Windows.
Open the "Run/Debug Configurations" dialog.
In the "Run" section, click to select an alternative JRE
Navigate to and then select the special KOS debug JRE.
Location of JRE files
The KOS JRE files are stored at different locations, depending on the operating system.
|
Here’s the Windows JRE picker:
Here’s the Mac JRE picker:
After selecting the alternative JRE, the following appears.
Notice that the JRE has changed. Click OK to close this window.
Debug Instructions
Details about how to fill in the main class and command line arguments are covered in the How To Debug Code tutorial. |
Follow these steps when using the Eclipse IDE. The instructions are basically the same for Linux, Mac, and Windows.
Open the "Debug Configurations" dialog and then click the "JRE" tab.
Select "Alternate JRE" and then click the "Installed JREs…" button.
Click "Directory" and then navigate to and select the KOS JRE directory.
Location of JRE files
The KOS JRE files are stored at different locations, depending on the operating system.
|
Here’s the Windows JRE picker:
Here’s the Mac JRE picker:
In this article you learned how to configure your Java IDE to enable debugging.
Check out the How To Debug Code tutorial to find out how to actually debug your code.