Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

runtime.exec in linux

 
lavnish lalchandani
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have a java code , running on linux ,
Runtime.exec("java -classpath /usr/home/App1/ViewController/classes;/usr/home/lib/abc.jar model.demo.Arguments user1 user2 user3");

ON running the above i get error
java.lang.ClassNotFoundException user1

Arguments.class is in folder /usr/home/App1/ViewController/classes/model/demo
Arguments.java has package model.demo

??? Am i giving something wrong ??
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, if you're running Java 1.5 or higher, you might want to take a look at the newer ProcessBuilder class:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic