thufir

exec process

Jun 29th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. thufir@dur:~$
  2. thufir@dur:~$ java -jar NetBeansProjects/Skype/dist/Skype.jar
  3. Exception in thread "main" java.lang.IllegalThreadStateException: process hasn't exited
  4. at java.lang.UNIXProcess.exitValue(UNIXProcess.java:217)
  5. at net.bounceme.dur.skype.Skype.main(Skype.java:14)
  6. thufir@dur:~$
  7. thufir@dur:~$ cat NetBeansProjects/Skype/src/net/bounceme/dur/skype/Skype.java
  8. package net.bounceme.dur.skype;
  9.  
  10. import java.io.IOException;
  11. import java.util.logging.Level;
  12. import java.util.logging.Logger;
  13.  
  14. public class Skype {
  15.  
  16. private static final Logger log = Logger.getLogger(Skype.class.getName());
  17.  
  18. public static void main(String args[]) throws IOException {
  19. Runtime rt = Runtime.getRuntime();
  20. Process proc = rt.exec("uname -a");
  21. int exitVal = proc.exitValue();
  22. System.out.println("Process exitValue: " + exitVal);
  23. }
  24. }
  25. thufir@dur:~$
Advertisement
Add Comment
Please, Sign In to add comment