• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

calling a java program

I have a java program that I want to call from a perl script.

I have tried using the line:
java [program name]

This does not work. Is there a pecial syntax for calling programs in another language ?

Note: the perl script and my java class file are in the same directory
1 Solution
Try either

  system("java progname");

if you want output from the program displayed on the screen or

  $res = `java progname`;

if you want the output stored in a variable.  Note that those are backticks (the same key as the ~), not apostrophes.
admiralAuthor Commented:
Your answer worked great, thanks

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Tackle projects and never again get stuck behind a technical roadblock.
Join Now