i want to read anything written in the terminal the Java class read it and store it in variable to use it in another method
can any one help me?
public class Termainl {
public static void main (String args[] ) throws IOException{
String[] cmdArray = {"gnome-terminal","java -classpath /home/r/byz/ Orchestrator"};
try {
Runtime.getRuntime().exec(cmdArray);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}