How can I execute a Java program within a php script?

后端 未结 4 407
慢半拍i
慢半拍i 2021-01-02 22:02

I am writing a simple web upload script. The goal is to upload a file using php, and then calling a java program to process this file.
I have done the work for uploading

4条回答
  •  耶瑟儿~
    2021-01-02 23:03

    &1");//shows # of errors
    echo "
    "; echo exec("java theNameOfYourJavaProgram 2>&1");//this line executes it echo "
    "; echo shell_exec("javac theNameOfYourJavaProgram.java 2>&1 ");//compiles it ?>

提交回复
热议问题