Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Runtime.getRuntime().exec(shellscript)

  1. #1
    Junior Member
    Join Date
    May 2021
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Runtime.getRuntime().exec(shellscript)

    Hi
    working on existing program, calling Process process =Runtime.getRuntime().exec(shellscript), but always getting IO exception
    java.io.IOException: Cannot run program ,not found
    this is happening in unix environment, saw in unix path variable setting where the script exists,
    my doubt is is that shell script will see in the unix paht where shell script exists, or which default path Runtime.exec() will verify mentioned shell script.

    how the Runtime.exec(shellscript) will call the shell script , please explain

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Runtime.getRuntime().exec(shellscript)

    Have you tried giving the full path to the script file
    Or put the script file in the current directory where the java program is executing?

    Also have you tried with java program with a different script or program to execute?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Correct Command Format inside Runtime.getRuntime.exec(“ ”) block
    By ashwinbbb in forum Java Theory & Questions
    Replies: 1
    Last Post: June 18th, 2014, 04:17 PM
  2. Re: How to Navigate to a URL with Runtime.getRuntime().exec()
    By bharathpangu in forum Java Theory & Questions
    Replies: 1
    Last Post: March 19th, 2012, 12:09 PM
  3. Runtime.getRuntime().exec(command) - I get nothing
    By andersbk in forum What's Wrong With My Code?
    Replies: 0
    Last Post: October 7th, 2010, 08:47 PM
  4. How to Navigate to a URL with Runtime.getRuntime().exec()
    By Flash in forum Java SE API Tutorials
    Replies: 4
    Last Post: October 5th, 2009, 07:18 PM
  5. How to Navigate to a URL with Runtime.getRuntime().exec()
    By Flash in forum Java Code Snippets and Tutorials
    Replies: 4
    Last Post: October 5th, 2009, 07:18 PM