I am trying to run the following program
import java.io.*;
class classname
{ public static void main(String args[])throws IOException
{
InputStreamReader reader=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(reader);
int t=Integer.parseInt(in.readLine());
System.out.println(t);
} }
I have created a seperate file input_file in which i have the input as 89
But when i try to execute the following code through
Process p=runtime.getRuntime().exec("java classname <input_file" );
It does not executes
I am trying to know that how can execute these file redirection commands using java Runtime or ProcessBuilder.
I am trying to create a web interface The web interface is something like online compiler e.g. ideone.com
The user will have its input in the input textarea and code in the code are
When user will click on compile it will show the output
But i cant the redirect the output of my input file for java classname