Thank you for browsing.
I am currently thinking of creating an online compiler for Java.
In order to create it, I wanted to know how to create it in a modern way.
The online compiler I envision is like the so-called paiza.io,
The program you entered runs on the server side and returns the results.
My implementation image is as follows.
I think 2 is the most likely option, but I would like to do it with a poor server, so if possible, I would like to take 1 method.
I would appreciate it if you could give me some information to help me.
I don't know much about it, but as far as I've heard...
Lock up your environment with chroot
By the way, there was no Docker for the initial AtCoder's jash server, so I wrote it in full scratch (you controlled it with cgroups, didn't you?), and the current AtCoder is on LXC.
Lock up your environment with chroot
Lock up your environment with chroot
By the way, there was no Docker for the initial AtCoder's jash server, so I wrote it in full scratch (you controlled it with cgroups, didn't you?), and the current AtCoder is on LXC.
By the way, there was no Docker for the initial AtCoder's jash server, so I wrote it in full scratch (you controlled it with cgroups, didn't you?), and the current AtCoder is on LXC.
A few years ago, I created a system to compile and test the code that users entered in textarea and so on on the server side.
I don't know if it's modern or not, but I usually did it as follows.
StandardJavaFileManager
(it would be nice to implement the interface above and do it all on-memory, but I made it a file with the policy below.)Get the compiler from javax.tools.ToolProvider.getSystemJavaCompiler()
JavaCompiler.CompilationTask compilation=compiler.getTask(...)
compilation.call()
prints the class file to the location you set in fileManager earlier (compilation errors can be caught as Java exceptions)java
Specify -Djava.security.policy= (policy file path)
as the argument for the commandjava
command like -Dsome.property.key=hoge
.I hope it will be helpful.
© 2024 OneMinuteCode. All rights reserved.