Results 1 to 5 of 5
Thread: Process running or not
- 10-15-2008, 10:56 AM #1
- 10-15-2008, 11:11 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I don't think there is a direct way to test it. Did you rad the Java doc for Precess members, there may be a hint, but cannot be a direct way. But working on a thread it's possible.
- 10-15-2008, 11:42 AM #3
I explain the way how i did that in Java on linux with the help of shell script command:
run the command from java application which is:
Then read line by line the output and check if the process was launched by you.Java Code:String command="ps -A -U "+System.getProperty("user.name")+" -d"; try { String line; Process p = Runtime.getRuntime().exec(command); BufferedReader input =new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null) { System.out.println(line); } input.close(); }catch (Exception err) { err.printStackTrace(); }Last edited by serjant; 10-15-2008 at 11:44 AM.
- 11-15-2009, 09:41 AM #4
Senior Member
- Join Date
- Nov 2009
- Posts
- 235
- Rep Power
- 4
You could run int = Process.exitValue(); and see if it throws an IllegalThreadStateException.
- 11-16-2009, 03:09 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
This is very old thread, more than a year.
Similar Threads
-
Read Process Memory
By newms86 in forum New To JavaReplies: 2Last Post: 07-07-2008, 05:14 PM -
inter process communication
By ibtehal in forum NetworkingReplies: 5Last Post: 06-23-2008, 01:35 AM -
i need help in http process
By sureshjava in forum New To JavaReplies: 0Last Post: 01-29-2008, 04:56 AM -
How can I set a time out on the loading process
By paul in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 04:54 AM -
Linux process from java
By Ed in forum New To JavaReplies: 2Last Post: 07-04-2007, 05:03 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks