Debugging Java code with Eclipse

It is possible to remotely debug your Java™ code by using Eclipse. Being able to debug processes by using a proper debugging tool is a major advantage that Java extensions have over regular TurboIntegrator scripts.

Procedure

  1. Open the Tm1s.cfg file for the TM1® server where Java extensions are enabled.
  2. Add the following parameter to the file:
    JavaJVMArgs=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
  3. Save Tm1s.cfg.
  4. Restart the TM1 server.
  5. In Eclipse, click Run > Debug Configurations.
  6. Scroll down the tree on the left pane. Locate and double-click Remote Java Application to create a new profile.
  7. Change the default Port value to 1044. This corresponds to the address value in the JavaJVMArgs parameter you created in Step 2.
  8. Click Debug to start a remote debugging session.
  9. To add a breakpoint to your code, you can do one of the following:
    • Double-click in the margin of the line where you want to have a breakpoint.
    • Place the cursor in the line where you want a breakpoint and pressing Ctrl+Shift+B.
  10. Re-run your wrapper TurboIntegrator process with Java extensions.
    The execution will break at your breakpoint and you can step through.