简体   繁体   中英

Perl - Unable to call java jar file

system("java -jar \"TRNDHTMLtoPDF.jar\" \"test.pdf\" \"c.txt\" ");

Above code used to run a java jar file from Perl (cgi) page. When I run it from command prompt, it working fine, but when i try to run from a page, nothing happened, no error and no output.

$result= `"java -jar \"TRNDHTMLtoPDF.jar\" \"test.pdf\" \"c.txt\" "`;

When I try to print the $result. it show empty. Seems like the jar not executed at all. How do I solve this? Please advice.

You should try to use the character ' at the beginning and at the end. No escape with \\ should be needed anymore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM