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
精彩评论