Link to home
Start Free TrialLog in
Avatar of Bourke
Bourke

asked on

jar file problems

Hi,
   I've just created a jar file.  Part of my app is to send an email.  I do this by using the following:
           
           String[] cmd = new String[7];

            cmd[0] = "cmd.exe" ;
            cmd[1] = "/C" ;
            cmd[2] = "mail_args.pl";
            cmd[3] = strToEmail;  
            cmd[4] = strFromEmail;            
            cmd[5] = strSubject;            
            cmd[6] = strEmailBody;    

            Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec(cmd);

This is fine when I run the app not as a jar file but when I do I get the following error:
              'mail_args.pl' is not recognized as an internal or external command, operable program or batch file.

mail_args.pl is in the jar file.

Also in the app I have icons on the Title bar of the JFrame/JInternalFrames but when running the jar they dont
appear.

Anyone got any ideas?

thanks
V
Anyone have any ideas?
ASKER CERTIFIED SOLUTION
Avatar of nesnemis
nesnemis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mick Barry
you can't run a script out of your jar using exec()
Avatar of Bourke
Bourke

ASKER

I managed to sort out the image not displaying problem.

Would you know how to run a script in a jar without using exec?

thanks
V
Avatar of Bourke

ASKER

Or any alternative solution?