Results 1 to 8 of 8
Thread: Script execution from java
- 09-14-2010, 12:04 PM #1
Member
- Join Date
- Sep 2010
- Posts
- 16
- Rep Power
- 0
- 09-14-2010, 02:05 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
- 09-14-2010, 03:00 PM #3
Member
- Join Date
- Sep 2010
- Posts
- 16
- Rep Power
- 0
Clarifications
I am aware of runtime.exec() but just want to know if it holds good for all types of scripts like shell , perl , python etc. Now i dont have linux environment so first looking for code
- 09-14-2010, 03:40 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
- 09-17-2010, 04:40 PM #5
Member
- Join Date
- Sep 2010
- Posts
- 16
- Rep Power
- 0
Facing an issue in executing script.. could someone help
If the script exists in the same location as the java file. I am able to execute the script through java but if the script exists in different location i am not able to execute .. Could someone help
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("./hello.sh");
How to specify if the script exists in different location in unix machine ?
- 09-17-2010, 04:44 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
- 09-17-2010, 05:10 PM #7
Member
- Join Date
- Sep 2010
- Posts
- 16
- Rep Power
- 0
Which path variable ?
Hi ,
I am sorry am quite new to this unix environment. Could you please elaborate more ?. I used to run java program only in eclipse so not sure of the variables to be set.
Could you provide me the exact thing. Thanks for the reply.
- 09-17-2010, 05:34 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
If your script is stored here /path/to/your/script you either have to add the directory /path/to/your to your 'path' environment variable or you have to specify the complete path /path/to/your/script to one of the exec( ... ) methods. The OS needs a way to find your script.
kind regards,
Jos
Similar Threads
-
Execution stuck at ObjectInputStream .readObject() with NO Exception thrown.JAVA BUG?
By r00tb33r in forum NetworkingReplies: 2Last Post: 06-01-2010, 02:58 AM -
Java script
By kirtichopra2003 in forum Advanced JavaReplies: 1Last Post: 12-04-2009, 07:55 PM -
java script
By satti in forum Web FrameworksReplies: 0Last Post: 06-09-2009, 08:53 AM -
Need help in java program execution...
By sachinmittal in forum New To JavaReplies: 6Last Post: 10-10-2008, 02:37 PM -
How can I improve the execution time of a Java Project
By Ndt in forum Advanced JavaReplies: 25Last Post: 06-28-2008, 05:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks