-
shell scripts in solaris frm java
Hi Guys,
How to run the shell scripts from java under solaris? Following is the code what i have written..
Process p1 = Runtime.getRuntime().exec("/opt.sh");
p1.waitFor();
This is working perfectly under Linux OS. But got confused why it is not running under solaris..Can anybody please give me suggestions?
The error am getting is..
java.io.IOException: /export/home0/oracle/Testing/Day_12122006/SS7/opt.sh: cannot execute
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:54)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at java.lang.Runtime.exec(Runtime.java:364)
at java.lang.Runtime.exec(Runtime.java:326)
Thanks in advance..
-
Make sure that, you have given execute permission for ./opt.sh
otherwise try giving
Runtime.getRuntime().exec("sh ./opt.sh")
or
Runtime.getRuntime().exec(new String []{"sh","./opt.sh"})
Similar Threads
-
Replies: 1
Last Post: 01-17-2011, 01:50 AM
-
Replies: 9
Last Post: 09-19-2007, 05:58 AM
-
Replies: 1
Last Post: 05-13-2005, 06:46 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|