I have a java application using switch-case in while loop to excute command. How can i pass params to a running background java process via bash script ?, I don't want to using socket or webUI to pass data. Here is my code:
public static void main(String[] args) throws IOException {
boolean eof = false;
Scanner sc = new Scanner(System.in);
while (!eof) {
System.out.println("Enter your command!");
String data = sc.useDelimiter("\\<end>").next();
CommandField cmdF = gson.fromJson(data, CommandField.class);
switch (Command.Parse(cmdF.getCommand())) {
case LOGIN:
result = client.isLogged();
if (result) {
System.out.println("successful!");
} else {
System.out.println("failed!");
}
break;
}
}