Java class sandbox with instrumentation support for online judges.
It implements:
- a much faster, unsynchronized ASCII-only
System.outstream that's suitable for single-threaded online-judging scenarios - support for disallowing particular classes from being loaded, to force certain solutions trivialized by the standard library
- optional unbuffering of standard output, for interactive problems without requiring users to flush manually
- logging of exceptional exits to a state file
To run a class Submission with agent the following suffices:
$ java -client -javaagent:/code/java-sandbox-agent.jar=[option, ...] Submission
Supported fields for the option list are:
nobigmath— disablesBigIntegerandBigDecimal, raising appropriate exceptions if they are usedunicode— encodesSystem.outas UTF-8 instead of ASCII, sacrificing performance for Unicode supportnobuf— setsSystem.outas being line-buffered, for interactive problemsunsafe— enablessun.misc.Unsafe, which is disabled by default