In PHP code, I try to execute a Java program using shell_exec, but I get an empty string.
When I tried to execute the program in bash:
echo "aaa"
I get "aaa", but when I tried to execute the same file with
java MainApp
I have an empty string
This is java code
public class MainApp{
public static void main(String[] args)
{
System.out.print(":]");
}
}
When i do:
echo "aaa"
java MainApp
echo "bbb"
I get "aaa bbb"
I canβt get the line ::] How to make it work?
Is it possible that the print line with System.out.println (String) does not match the print echo line, does not match the return value
source
share