Programming Language compile and run library
Add maven dependancy
<dependency>
<groupId>kr.devdogs</groupId>
<artifactId>langexec</artifactId>
<version>0.1</version>
</dependency>
- Algorithm traning site
- Student assignment system
- Source code compile & receive compile result message
- Running source code program & get output of std output
- Interactive shell of programs using standard std input
Compile and Run a Java program that outputs the input as it is
// program that outputs the input as it is
File sourceFile = new File("/Users/daniel/Test.java");
LanguageLiveShell shell = LiveShellFactory.getJavaLiveShell(sourceFile);
shell.addOnOutputListener(new CustomOnOutputListener() {
@Override
public void onOutput(String output) {
System.out.println(output);
}
});
try (Scanner scan = new Scanner(System.in)) {
while (true) {
String input = scan.nextLine();
shell.writeLine(input);
// input "Hi!" => print "Hi!"
}
}