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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can't run a script out of your jar using exec()
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
Would you know how to run a script in a jar without using exec?
thanks
V
ASKER
Or any alternative solution?