compiler construction - Executing a java program having input statements through another java program -
hi trying make online java compiler.
as initial poc able compile , run program having no input statements dont'd know if there input statements also.
i using runtime.getruntime().exec compile , run input java program.
sample program having input statements trying run , execute :
public class helloworld { public static void main(string[] args) { system.out.println("hello world.................."); scanner sc = new scanner(system.in); system.out.println("enter name"); string name = sc.nextline(); system.out.println("you entered " + name); sc.close(); }
}
problem when compile , run above program through code compiles , runt getting "enter name" of system.out.println("enter name"); in helloworld.java after nothing happens.
Comments
Post a Comment