This problem was asked here multiple times but unfortunately, the responses I have seen did not help.
I am debugging Java code using the latest IntelliJ IDEA. I use remote JVM debug
. My Java app runs in a Docker container, and IntelliJ runs on my dev environment.
When IDEA stops at the breakpoint, all local variables show Debug information is inconsistent
instead of their actual value.
My dev environment where IDEA runs:
$ cat /etc/os-release
PRETTY_NAME="Amazon Linux 2"
ID_LIKE="centos rhel fedora"
I use this Java+Maven to build the project:
$ java -version
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment (build 21.0.2+13-58)
OpenJDK 64-Bit Server VM (build 21.0.2+13-58, mixed mode, sharing)
$ mvn -version
Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: /home/xxxx/dev/applications/maven/apache-maven-3.8.8
Java version: 21.0.2, vendor: Oracle Corporation, runtime: /home/xxxx/dev/applications/java/jdk-21.0.2
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.15.160-104.158.amzn2.x86_64", arch: "amd64", family: "unix"
Docker container where the Java app runs:
# cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.19.1
PRETTY_NAME="Alpine Linux v3.19"
# java -version
openjdk version "21.0.3" 2024-04-16
OpenJDK Runtime Environment (build 21.0.3+9-alpine-r0)
OpenJDK 64-Bit Server VM (build 21.0.3+9-alpine-r0, mixed mode, sharing)
# ps axu | grep java
260 root 1:24 java -Xms512m -Xmx512m -XX:+UseZGC -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000 -jar /jar-to-run/xxx-service-0.1.0.jar
I also set the project JVM to point to the same Java I used for the build.
What do I miss here?