Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To run java codes in sandbox #60

Open
Nageshmal opened this issue Jul 17, 2012 · 4 comments
Open

To run java codes in sandbox #60

Nageshmal opened this issue Jul 17, 2012 · 4 comments

Comments

@Nageshmal
Copy link

I actually thought of running java codes locally in sandbox instead of running it in ideone.com . Please suggest me how to do this .

@sunner
Copy link
Member

sunner commented Jul 17, 2012

Implement a java wrapper as judge engine. The wrapper should protect system from malicious java programs.

@Nageshmal
Copy link
Author

Please can u explain how to implement java wrapper as judge engine .

@sunner
Copy link
Member

sunner commented Jul 17, 2012

You can read the code in judge/

@kanikeabhishek
Copy link

So, In /var/www/moodle/local/onlinejudge/judge/sandbox/lib.php (gedit application)

class judge_sandbox extends judge_base {
protected static $supported_languages = array(
'c' => 'gcc -m32 -D_MOODLE_ONLINE_JUDGE_ -Wall -static -o %DEST% %SOURCES% -lm',
'c_warn2err' => 'gcc -m32 -D_MOODLE_ONLINE_JUDGE_ -Wall -Werror -static -o %DEST% %SOURCES% -lm',
'cpp' => 'g++ -m32 -D_MOODLE_ONLINE_JUDGE_ -Wall -static -o %DEST% %SOURCES% -lm',
'cpp_warn2err' => 'g++ -m32 -D_MOODLE_ONLINE_JUDGE_ -Wall -Werror -static -o %DEST% %SOURCES% -lm',
'java' => 'javac -m32 -D_MOODLE_ONLINE_JUDGE_ -Wall -static -o %DEST% %SOURCES% -lm'
);

If u see above array i have included java compiler option... Is this enough to run java programs in sandbox???
When i did that i got a compilation Error as:
Details: javac: invalid flag: -m32
Usage: javac
use -help for a list of possible options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants