Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

calling Jar file

15 views
Skip to first unread message

Lemba

unread,
Aug 19, 2009, 7:08:32 PM8/19/09
to begi...@perl.org
Hi All,

My perl script is wrapper for Java program. So, I'm calling the jar file
in my script.

my $compiler = "Compiler.jar"

system ( "java -jar $compiler arg1 arg2 arg3" )

or in this way

my @args = ( "java", "-jar", "$compiler", "arg1", "arg2", "arg3" );
system( @args )

Both approaches are not working as expected. They execute jar ok but
java is crasing somewhere and gives error.
I did workaround. I created ms-dos batch script and execute jar with the
same command. Works perfect! The bad thing about ms-dos batch scripting
that it doesnt support arrays.
So I'm stuck. The last thing I tried, I'm calling the batch script
inside perl, which calls jar. Same error. I believe something is wrong
with perl shell. Any ideas? Any help will be much appreciated.

Kind Regards,
Vladimir


Eric Veith

unread,
Aug 21, 2009, 3:55:38 AM8/21/09
to lemba, begi...@perl.org
lemba <le...@sbcglobal.net> wrote on 08/20/2009 01:08:32 AM:
> Both approaches are not working as expected. They execute jar ok but
> java is crasing somewhere and gives error.

What error do you get?

------------------------------------------------------------------------------------------

IBM Systems & Technology Group
IBM Deutschland
Hechtsheimer Str. 2
55131 Mainz
E-Mail: erv...@de.ibm.com

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Erich Baier
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

0 new messages