Is there a way using Java that I can gain a list of all active processes running on a Mac?
I can do so in Windows using the code below to return the Task List, but that throws an exception on a Mac. I want my app to stop if certain applications are also running.
Any ideas? Thanks.
Windows Code:
Process p = Runtime.getRuntime().exec("tasklist.exe /nh");
BufferedReader input = new BufferedReader
(new InputStreamReader(p.getInputStream()));
//while there are more processes in the task manager list
while ((line = input.readLine()) != null) {
//insert code here for each task running
}