Debugging Java requires multiple tools installations:
- Ride-7 IDE is available on the Raisonance web site.
- At the top of Ride-7 you need to install the specific RKit-Java also available on the Raisonance web site.
- to compile your Java code, you need the javac compiler from Oracle. By default, we recommend to install OpenJDK 1.8
- IoTize Studio needs also to be installed to provide the IOT_JVM environment and classes.
Note that all these tools are available for free.
With RIDE-7, you will have a full-featured editor and the environment will allow you to compile directly your Java code. Then, two JVM are available for debugging:
- the simulator running on your computer (that is more or less the same JVM compiled for Windows),
- the debugger that needs a connected TapNLink.
Various constraints exist:
- debugging at the assembly level is very difficult and we assume that you have the original Java source file.
- the size settings (size size, minimal code size,...) defined in RIDE must match with the configuration settings defined in Studio (and loaded into the Tap configuration memory).
- when debugging with the real time debugger, you must be logged as administrator. Credentials have to be entered in the debugger options.
When starting a debug session, the following actions will be performed: - the Java program will be compiled and linked (if they are more recent than the bcb file), - the CRC code will be checked. If both CRC match, the code will not be uploaded. If they differ, the code will be uploded in RAM (not in FLASH) only if the available space code is large enough.
We recommend to set the 'minimal code size' to a few kilobytes more than what you really need to be sure that you could debug without changing the whole configuration. Note that the code size cannot exceed 14KB since it is included into the overall 16KB configuration.
Differences between the simulator and the debugger
Debugging on the real TAP allow to access directly to the hardware resources (IOs, real variables,...). But very often, these variables can be forced manually in the simulator.
On the other hand, the simulator provides some extra features that are not available in the real time debugger, such as:
- code coverage,
- breakpoint on data access.
Because the JVM is pure software, executing on a PC is faster than on the real TAP.
The initial version (2020Q1) of the JVM had many limitations that have been fixed: - it used to support only a single class, - the memory management was almost 'static' (no more limitation but the overall RAM size reserved for the JVM), - many native methods have been added, - the JSON class was not debuggable, - debugging was not possible... Therefore, we strongly recommend to use a version greater than 2.0 for Duetware.