-
Notifications
You must be signed in to change notification settings - Fork 0
Java
Derek Clemenzi edited this page Apr 26, 2021
·
6 revisions
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006 -jar <jar name>
or you can use
export JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5006"
java $JAVA_OPTS -jar <jar name>
Create a Remote run configuration:
- Run -> Edit Configurations...
- Click the "+" in the upper left
- Select the "Remote" option in the left-most pane
- Choose a name (I named mine "remote-debugging")
- Click "OK" to save:
Start your application as you would normally, then in IntelliJ select the new configuration and hit 'Debug'.
https://stackoverflow.com/questions/21114066/attach-intellij-idea-debugger-to-a-running-java-process
Port forwarding
ssh -L 9010:localhost:9010 -L 9011:localhost:9011 <username>@<ip>
jconsole localhost:9010
java-1.8.0-openjdk-devel-1.8.0.292.b10-1.el7_9.x86_64
sudo -u tomcat /bin/jmap -dump:live,format=b,file=/home/carolina/mw-dump <PID>