I want to open separate console per class.
I have three classes. One main class, one class where I read the arguments and the other class which does the print job.
public class MainClass {
public static void main(String[] args) {
Readarguments arg = new Readarguments();
String str = null;
do{
str = arg.readargs();
PrintVals pv =new PrintVals();
pv.print(str);
}while(!str.equalsIgnoreCase("exit"));
}
}
This class prints onto console
public class PrintVals {
void print(String val){
System.out.println(val);
}
}
This one reads the arguments from console
public class Readarguments {
String readargs(){
System.out.print("enter the val :");
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(in);
String str = null;
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
Now, I am planning to launch all three classes from three different consoles. The console with Readarguments.class will be used to feed the input. while the console with PrintVals.class will print out the values.
All three java files and their respective class files are in same folder.
I am trying to open class files in separate console through command line
java Class<Readarguments>.class
As mentioned in one of the answers in here How to run multiple consoles from one class?
But I am getting a error message
The system cannot find the file specified
Thanks in advance.