开发者

How to add sudo for a debug configuration in Eclipse, in Ubuntu?

开发者 https://www.devze.com 2023-01-22 21:11 出处:网络
In eclipse for a particular debug configuration I need to put \"sudo\" before the executab开发者_如何学Gole in order to gain root privileges.

In eclipse for a particular debug configuration I need to put "sudo" before the executab开发者_如何学Gole in order to gain root privileges.

Is there a way to do this rather than launching eclipse with sudo?


You can run your java application with root privilege, then attach the process to debug.

sudo java -jar xxx.jar -vmargs -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000

attach the localhost:8000 to debug your app in eclipse

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号