2

I'm facing a problem with calling java from php on a linux server with popen.

$java = '/usr/bin/java';
$cmd = "$java -jar javafiles/register.jar < $tmpFile";

What does the < before $tmpFile mean? Because apparently it is loading the content of $tmpFile from disk and inputting it directly on the console of the register.jar execution. Is that the case? Because the content of $tmpFile has special characters and these aren't being encoded in the right charset.

Nathan Hughes
  • 85,411
  • 19
  • 161
  • 250

1 Answers1

3

Thats exactly what it does. Specifically, it runs the program and sends the contents of $tmpFile into the standard input (System.in) of the program being executed.

Eric Petroelje
  • 57,359
  • 8
  • 118
  • 174