Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6910679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:50:44+00:00 2026-05-27T08:50:44+00:00

I am Executing Shell scripts in Java Using Cygwin. My Scripts are running fine

  • 0

I am Executing Shell scripts in Java Using Cygwin. My Scripts are running fine at command prompt, and even if I try simple shell scripts through Java it works fine.

But now my scripts are using another shell scripts from the folder called lib
So I need to include lib folder into my project.

Can any one suggest the way how to include shell script as a part of Java project.

Lib Folder–>

  • lib/lib.sh
  • lib/paxus.sh
  • lib/preload.sh
  • lib/tgzcreator.sh
  • lib/specific.sh

InSide Lib Folder these are the Shell scripts. Which my_script.sh is using.

Edit:- I want to add Shell script inside my project which uses Command line arguments and some other scripts from above folder structure.

 cmd = "D:/cygwin/bin/bash -c '/bin/my_script.sh 121 121 1212 12121'";

Help me for Doing this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:50:45+00:00Added an answer on May 27, 2026 at 8:50 am

    If you are using maven as a build tool the best solution is to add scripts under /src/main/resources. In this case the scripts will be automatically included into your jar file, so you will be able to extract them on the fly from your java code and run.

    If you want to have the scripts separately you suggested good solution. I mean lib folder. But again since I am using maven I’d put them under /src/main/sh (exactly as I put my java files under /src/main/java)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java Webapplication running on Tomcat, executing Shell scripts at runtime in
I was Able to Run shell Script using Cygwin in java. But Now I
I am running a Shell script using cygwin. Process p; InputStream in; BufferedReader br;
I need something like make i.e. dependencies + executing shell commands where failing command
I'm executing a shell pipeline from a java program - it'll be something like
I am facing a copy command problem while executing shell script in RHEL 5.
I'm trying to write a script to query ActiveMQ through the shell (using the
Is is possible to print the execution time of a shell command with following
Try executing the following in JavaScript: parseInt('01'); //equals 1 parseInt('02'); //equals 2 parseInt('03'); //equals
I want to pass a command to a shell script. This command is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.