跳至主要內容

TOOLFK tool-online - JAVA code execution tool

This article recommends [TOOLFK] online- JAVA code execution tool, provides JAVA code online execution function.

Code teaching

This tool [online JAVA code execution tool] depends on the Docker Java image
STEP 1 interface
STEP2
The execution code is as follows
 static function dockerRunJava($code){
        $ext                       =   "java";

        preg_match("/public\s*class(.*)\s*[extends|implement]*{/",$code,$matches);
        $filename                  =   "";
        if($matches){
            $filename              =   trim($matches[1]);
        }

        list($base_url,$filename)  =   self::runWriteFile("Java",$code,$ext,$filename);
        $build_name                =   str_replace(".".$ext,"",$filename);
        $full_path                 =   $base_url."/".$filename;
        return self::dockerRun($base_url,' java:latest /bin/bash -c "javac '.$filename.' && java '.$build_name.'" ',$ext,$full_path);
    }

private static function dockerRun($base_url,$cmd,$pre,$full_path){
        $random_name    =   $pre.mt_rand(1,999999999999);
        $cmd            =   env("TOOL_DOCKER_PATH")." run --name {$random_name} --rm  -v {$base_url}:/usr/src/{$pre}  -w /usr/src/{$pre} {$cmd} 2>&1";
        $res            =   shell_exec($cmd);

        return $res;
}

 

留言

此網誌的熱門文章

TOOLFK Tool-Online Chinese / Letter / RMB / Simplified and Traditional Conversion Tool

The [TOOLFK] online Chinese character / letter / RMB / Simplified and Traditional Chinese conversion tool to be recommended in this article provides online daily use tools for Simplified and Traditional Chinese online conversion, RMB capitalization conversion, letter case conversion, and Chinese to Pinyin conversion. Website name: ToolFk website link:  https://www.toolfk.com/Tool link:  https://www.toolfk.com/tool-online-convert Code teaching This tool [online Chinese character / letter / RMB / Simplified and Traditional Chinese conversion tool] depends on the code base (you can view the TOOLFK website source code to view) http: //www.toollibs.com/togglecase transverter.js / pinyin_dict_withtone.js / pinyin_dict_polyph / rmb.js / ec- do .js STEP 1 Online Chinese to Pinyin tool STEP 2 Online Simplified and Traditional Online Conversion Tool STEP 3 Online RMB capital conversion tool STEP4 online letter case conversion tool STEP5 The core code of ...

HTML online for code formatting, beautification, encryption, decryption, compression, turn a key tool -toolfk online Programmer toolbox

    This paper to recommend [ToolFk] is a programmers often use a free online test kit, ToolFk feature is focused on everyday programmer development tools, without having to install any software, as long as the content execution affixed by a button, able to obtain the contents of the desired results. ToolFk also supports    BarCode Barcode generated online  ,   QueryList collector  ,   PHP code is run online  ,   PHP confusion, encryption, decryption  ,   Python code is run online  ,  JavaScript online operation  , YAML formatting tools  ,  HTTP simulation query tool  ,  HTML online toolbox  ,  JavaScript online Toolbox  , CSS online toolbox  ,  JSON online toolbox  ,  unixtime timestamp conversion  ,  Base64 / the URL of / native2ascii conversion  ,  CSV conversion kit  ,  XML online toolbox  ,...

How to Download tencent video online for free? tencent Video Downloader -VideoFK

In line to see some friends in the query how to download tencent video on the computer, and this article will be introduced "  Videofk.com  " is a free tencent video online video download site, download method is very simple, just copy the video link, paste it into the query box, click on the search button, then you can quickly save mp4 videos to your PC or mobile phone. Visit website link:  https://www.videofk.com/weishi-video-download Tutorial STEP 1 Open   Videofk   website, you need to download the tencent video link to copy and paste it into the bottom, click on the search button below to obtain cover art and movie download button. STEP 2 In  Videofk  After parsing the video?, Are the following methods for you to download? Choose. 1, click on the top cover map of the "  Download  " button to quickly download videos to the local. 2, click on the cover drawing any position, a window will pop up, w...