I have to make a java program which checks first if the user running the program in UNIX is root or not. I know the command id -u but I don't know how to implement it in the Java program. Any help would be appreciated.
There's no way to check for a root user in native Java, since the concept is OS-dependent and therefore excluded under the "write-once/run-anywhere rule". The easiest way to check is to do a Runtime.exec on the "id -u" or "id -g" command. You'll have to capture and parse the number passed back on stdout.
Customer surveys are for companies who didn't pay proper attention to begin with.