This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
i want to run a package containing .class files from a java program for this i have written: Process tempProcess=Runtime.getRuntime().exec("java "+ mainClassName,null,new java.io.File(absolutePackagePath)); tempProcess.waitFor(); but the problem is that i am not able to given input to this tempProcess or see output of it.
Aside from the issues that Ulf pointed out, are you also sure you want to start a new JVM to run your sub-application? Depending on exactly what you want to achieve, you may find the Reflection API more useful and appropriate. Things get slightly complicated if the .class files aren't already in your current classpath (you may need to create a new class loader), but this may still be better than using Runtime.exec().