Getting Started

Requirements

Your application or test case running under an OpenJDK or Oracle JVM on a supported Linux distribution.

  • JDK and its debug symbols and, for convenience when debugging, source for the standard Java libraries installed. If using distro-supplied versions of JDK:

    • RHEL/CentOS/SuSE:

      • java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel packages and $ sudo dnf debuginfo-install java-1.8.0-openjdk-headless , or

      • java-11-openjdk-headless java-11-openjdk-devel packages and $ sudo dnf debuginfo-install java-11-openjdk-headless , or

      • java-15-openjdk-headless java-15-openjdk-devel packages and $ sudo dnf debuginfo-install java-15-openjdk-headless .

    • Debian/Ubuntu:

      • openjdk-8-jdk-headless openjdk-8-dbg openjdk-8-source packages, or

      • openjdk-11-jdk-headless openjdk-11-dbg openjdk-11-source packages, or

      • openjdk-15-jdk-headless openjdk-15-dbg openjdk-15-source packages.

  • The ability to copy the LiveRecorder software into this environment.

  • IntelliJ IDEA running in the same Linux environment as your application, or running on a separate Windows, macOS or Linux machine.

  • If the environment is a remote machine or a VM:
    A port (default 9000) opened into the environment for IntelliJ to connect over.
  • The LiveRecorder IntelliJ IDEA Plugin:
    Follow Jetbrains’ Install plugin from repository instructions,
    search for “LiveRecorder” in the Marketplace, press “Install” and restart IntelliJ IDEA.

If your application and IntelliJ are running on the same Linux machine continue with Local Time Travel Debugging.

If your application and IntelliJ are running on the different machines skip to Remote Time Travel Debugging.

Local Time Travel Debugging

Unzip the file lr4j-replay-*.zip. This creates a directory named lr4j.

In IntelliJ’s settings:

  • Search for “LiveRecorder”.

  • Click on Build, Execution, Deployment → Debugger → LiveRecorder.

  • Press the “…” button to the right of the “LiveRecorder replay tool directory” setting and navigate to the location of the lr4j directory.

In IntelliJ’s main window:

  • Open your project if it’s not already open.

  • Choose Run → Edit Configurations, press the “+” button, and select “LiveRecorder → Application”.

  • Choose the main class of the application that you want to debug and adjust the other options as required.

Refer to Debugging in IntelliJ IDEA for next steps.

Remote Time Travel Debugging

In IntelliJ’s main window:

  • Open your project if it’s not already open.

  • Choose Run → Edit Configurations, press the “+” button, and select “LiveRecorder → Remote”.

  • Specify the machine running your application as the “Host” (or use localhost if your application is running on the same machine as IntelliJ).

  • Adjust the “Port” setting to match the port that you opened up into the remote environment above.

On the remote Linux machine:

  • Unzip the file lr4j-replay-*.zip. This creates a directory named lr4j.

  • Edit the command-line used to launch Java to add the following arguments to the java command-line.

    -agentpath:${LR4J}/undo-jdwp-agent-1.0.so -javaagent:${LR4J}/undo-jdwp-instrument-1.0.jar -XX:-Inline -XX:TieredStopAtLevel=1 -Dsun.zip.disableMemoryMapping=true -Dundo.bridge.port=${PORT}
    

    replacing ${LR4J} with the path to the lr4j directory, and replacing ${PORT} to match the port that you opened up into the remote environment above.

Refer to Debugging in IntelliJ IDEA for next steps.