mirror of
https://github.com/engineer-man/piston.git
synced 2025-06-08 03:06:26 +02:00
java support
This commit is contained in:
parent
e050d5ae35
commit
5d8f52afd3
3 changed files with 16 additions and 6 deletions
|
@ -50,6 +50,9 @@ case "$lang" in
|
|||
"nasm" | "asm")
|
||||
bin=executor_nasm
|
||||
;;
|
||||
"java")
|
||||
bin=executor_java
|
||||
;;
|
||||
*)
|
||||
echo "invalid language"
|
||||
exit
|
||||
|
@ -72,6 +75,7 @@ docker run \
|
|||
-v $dir/executors/r:/executor_r:ro \
|
||||
-v $dir/executors/php:/executor_php:ro \
|
||||
-v $dir/executors/nasm:/executor_nasm:ro \
|
||||
-v $dir/executors/java:/executor_java:ro \
|
||||
piston \
|
||||
runuser \
|
||||
-l runner \
|
||||
|
|
5
docker/executors/java
Executable file
5
docker/executors/java
Executable file
|
@ -0,0 +1,5 @@
|
|||
cp /*.code .
|
||||
name=$(cat $1 | grep -Eo 'public class ([A-Za-z0-9]+)' | cut -d' ' -f3)
|
||||
mv $1 $name.java
|
||||
timeout -s KILL 10 javac $name.java
|
||||
timeout -s KILL 3 java $name ${@:3}
|
Loading…
Add table
Add a link
Reference in a new issue