如何在 Ubuntu 中的 Eclipse 中添加 sudo 进行调试配置?

发布于 2024-09-29 22:04:52 字数 102 浏览 0 评论 0原文

在 Eclipse 中,对于特定的调试配置,我需要在可执行文件之前添加“sudo”以获得 root 权限。

有没有办法做到这一点,而不是用 sudo 启动 eclipse ?

In eclipse for a particular debug configuration I need to put "sudo" before the executable in order to gain root privileges.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滥情哥ㄟ 2024-10-06 22:04:52

您可以使用root权限运行您的java应用程序,然后附加该进程进行调试。

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

附加 localhost:8000 以在 Eclipse 中调试您的应用程序

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文