mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-08 12:18:43 +00:00
fix: change fixed jdk runtime path to latest
The original judge client default uses jdk 7u76 and 8u31, and cannot change to the newest version. This commit will change the folder into _latest. Prepare for new installation script.
This commit is contained in:
parent
c5ef73dc76
commit
ec743dd808
@ -1103,7 +1103,7 @@ RunCompilerResult compile_java7(const string &name, const string &path = work_pa
|
||||
executef("echo package %s\\; | cat - %s/%s.code >%s/%s/%s.java", name.c_str(), path.c_str(), name.c_str(), path.c_str(), name.c_str(), main_class.c_str());
|
||||
|
||||
return run_compiler((path + "/" + name).c_str(),
|
||||
(main_path + "/run/runtime/jdk1.7.0_76/bin/javac").c_str(), (main_class + ".java").c_str(), NULL);
|
||||
(main_path + "/run/runtime/jdk1.7.0_latest/bin/javac").c_str(), (main_class + ".java").c_str(), NULL);
|
||||
}
|
||||
RunCompilerResult compile_java8(const string &name, const string &path = work_path) {
|
||||
RunCompilerResult ret = prepare_java_source(name, path);
|
||||
@ -1116,7 +1116,7 @@ RunCompilerResult compile_java8(const string &name, const string &path = work_pa
|
||||
executef("echo package %s\\; | cat - %s/%s.code >%s/%s/%s.java", name.c_str(), path.c_str(), name.c_str(), path.c_str(), name.c_str(), main_class.c_str());
|
||||
|
||||
return run_compiler((path + "/" + name).c_str(),
|
||||
(main_path + "/run/runtime/jdk1.8.0_31/bin/javac").c_str(), (main_class + ".java").c_str(), NULL);
|
||||
(main_path + "/run/runtime/jdk1.8.0_latest/bin/javac").c_str(), (main_class + ".java").c_str(), NULL);
|
||||
}
|
||||
|
||||
RunCompilerResult compile(const char *name) {
|
||||
|
@ -208,10 +208,10 @@ void parse_args(int argc, char **argv) {
|
||||
string pre[3] = {"/usr/bin/python3.4", "-I", "-B"};
|
||||
run_program_config.argv.insert(run_program_config.argv.begin(), pre, pre + 3);
|
||||
} else if (run_program_config.type == "java7u76") {
|
||||
string pre[3] = {abspath(0, string(self_path) + "/../runtime/jdk1.7.0_76/bin/java"), "-Xmx1024m", "-Xss1024m"};
|
||||
string pre[3] = {abspath(0, string(self_path) + "/../runtime/jdk1.7.0_latest/bin/java"), "-Xmx1024m", "-Xss1024m"};
|
||||
run_program_config.argv.insert(run_program_config.argv.begin(), pre, pre + 3);
|
||||
} else if (run_program_config.type == "java8u31") {
|
||||
string pre[3] = {abspath(0, string(self_path) + "/../runtime/jdk1.8.0_31/bin/java"), "-Xmx1024m", "-Xss1024m"};
|
||||
string pre[3] = {abspath(0, string(self_path) + "/../runtime/jdk1.8.0_latest/bin/java"), "-Xmx1024m", "-Xss1024m"};
|
||||
run_program_config.argv.insert(run_program_config.argv.begin(), pre, pre + 3);
|
||||
}
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ void init_conf(const RunProgramConfig &config) {
|
||||
soft_ban_file_name_set.insert("/etc/nsswitch.conf");
|
||||
soft_ban_file_name_set.insert("/etc/passwd");
|
||||
|
||||
add_file_permission(abspath(0, string(self_path) + "/../runtime/jdk1.7.0_76") + "/", 'r');
|
||||
add_file_permission(abspath(0, string(self_path) + "/../runtime/jdk1.7.0_latest") + "/", 'r');
|
||||
readable_file_name_set.insert("/sys/devices/system/cpu/");
|
||||
readable_file_name_set.insert("/proc/");
|
||||
statable_file_name_set.insert("/usr/java/");
|
||||
@ -421,7 +421,7 @@ void init_conf(const RunProgramConfig &config) {
|
||||
soft_ban_file_name_set.insert("/etc/nsswitch.conf");
|
||||
soft_ban_file_name_set.insert("/etc/passwd");
|
||||
|
||||
add_file_permission(abspath(0, string(self_path) + "/../runtime/jdk1.8.0_31") + "/", 'r');
|
||||
add_file_permission(abspath(0, string(self_path) + "/../runtime/jdk1.8.0_latest") + "/", 'r');
|
||||
readable_file_name_set.insert("/sys/devices/system/cpu/");
|
||||
readable_file_name_set.insert("/proc/");
|
||||
statable_file_name_set.insert("/usr/java/");
|
||||
|
Loading…
Reference in New Issue
Block a user