Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Run .sh file from Java - problem

975243Nov 20 2012 — edited Nov 21 2012
Hi,
I have problem..
I have to run file try.sh from Java 1.4 and it doesnt work.

I have tried this code:
Runtime.getRuntime().exec("sh ./try.sh");
or
Runtime.getRuntime().exec("sh ./try.sh");
or
Runtime.getRuntime().exec("/bin/bash -c /home/oracle/try.sh");
and many many more....

What's more I dont get any error or excepion.
When I'm trying to run try.sh file in the command line (./try.sh) it is working.

I would be gratefull if somebody could help me.

Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 19 2012
Added on Nov 20 2012
4 comments
900 views