I am trying to run a script in SUSE Linux Enterprise 12 from java using
ProcessBuilder. Codes for this follows:
ProcessBuilder pb = new ProcessBuilder("xterm", "-e", "script_path"); Process pr = pb.start();
then I read the messages from
Process, it is saying
xterm: no absolute path found for shell: script_path
So I tried from the Gnome-Terminal I have in SUSE, and used the commands
xterm script_path but found the same error message. I tried both form root and from local user. I am completely out of clues about this error.
And the main condition is I have to able to run this code as root as my java code has to be invoked as root only.
I have tried again and now I actually have a new error message from the
ProcessBuilder. The message I get from the
error extracting:: error message: Warning: This program is an suid-root program or is being run by the root user. The full text of the error or warning message cannot be safely formatted in this environment. You may get a more escriptive message by running the program as a non-root user or by removing the suid bit on the executable. xterm: Xt error: Can't open display: %s xterm: DISPLAY is not set
The script I am trying to execute is
#!/bin/bash sudo unzip -o postgresql-9.4.6-linux-64.zip -d some_path/db/ sleep 3