Alex Rivera | Logout

IntelliJ - Running Program as Sudo

Asked 2010-12-10T21:39:52.643
47

Developing a program on OSX using Java and IntelliJ. Deals with network sockets and ICMP. Hence, the program needs to be run as root or sudo'd on OSX. Program runs fine from a terminal window outside IntelliJ under sudo. However, I would like to debug and run it from IntelliJ (V9). In IntelliJ it errors (I need root privs to enumerate network devices). I know how to pass program and VM parameters in IntelliJ but now how to hit Run and/Debug and have it run under sudo? What is needed is basically sudo java ...... MyProgram instead of java ..... MyProgram Any ideas or workarounds.

Edit
Report

1 Answer

3

Debugging of sudo programs is disallowed by the operating system unless the debugger is running as root, for security reasons.

So, even if you can figure out how to get IntelliJ to use sudo it won't do you any good.

answered 2010-12-10T22:37:49.840

Your Answer