0

when i try to run the php code to execute my java program which contain in the same folder (Assignment/src/testing/test.php and Assignment/src/testing/test.java)

Here is my code

test.php

<?php
    shell_exec("javac test.java");
    shell_exec("java test");
?>

test.java

package src.testing;

class test {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

an error message display

error: file not found: test.java

Usage: javac (options) (source files)

Error: Could not find or load main class test

Caused by: java.lang.ClassNotFoundException: test

a way to solve the problem

0 Answers0