import java.io.File;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.*;
import java.io.InputStream;
class pbdemo {
static publ
Simple answer.
ProcessBuilder
don't have getInputStream
method.
See this: ProcessBuilder
You can use:
BufferedReader br=new BufferedReader(new InputStreamReader(pb.start().getInputStream()));
You are trying to get an InputStream
from a ProcessBuilder
and that's wrong.
ProcessBuilder.start()
returns a Process object, and that's the one who has a getInputStream()
method.
Try switching that line for this one.
BufferedReader br=new BufferedReader(new InputStreamReader(pb.start().getInputStream()));
Or
Process pro = pb.start();
BufferedReader br=new BufferedReader(new InputStreamReader(pro.getInputStream()));