This content has been marked as final. Show 4 replies
And when you invoke that command by opening a command prompt/shell and typing it in there, does it work? Because it seems like the OS is telling you that 'xterm' does not exist.
You should also read this article if you haven't already, it is required reading when you start to fudge around with processes and especially command line invocations.
As stated above the following command is working fine when execute from Mac terminal:
diskutil eraseDisk exFAT newdisk disk1
Note: diskutil is the program being run, eraseDisk is the operand, exFAT is the format of the new disk, newdisk is the name of the new disk, and disk1 is the mount point for the disk to be formatted.
But I not knowing how to convert this into Java program to execute.
You are not getting an error message containing the word 'xterm' with the commands that don't have 'xterm' in them.
I suggest you report the actual problem you are getting with each of those command arrays. Don't bother with the second one as it isn't valid.
I would try to use the full path of xterm or diskutil as the first parameter. Other problems may follow, but let's see if this solves this specific issue.