P45 Imminent
P45 Imminent

Reputation: 8591

How do I disable remote debugging

Currently I start up a Java Virtual Machine with the following command line arguments

-Xint -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=4000,suspend=n

This allows me to attach a debugger to that JVM with both JVM and debugger on the same machine. However it also allows the remote debugging of that session. My system adminstrator points out to me that this can be insecure and doesn't want me to do that.

But which command line arguments do I need to change so I can attach a debugger on the local machine to that JVM, just not a remote one?

I'm using Java 8 but happy to migrate to Java 9 if that's what it takes.

Upvotes: 1

Views: 2085

Answers (1)

Sunchezz
Sunchezz

Reputation: 778

Just write your local adress before the port like this:

-Xint -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=127.0.0.1:4000,suspend=n

as wildcard for access from every adress, you could also use:

-Xint -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=0.0.0.0:4000,suspend=n

Upvotes: 3

Related Questions