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 8054107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:04:29+00:00 2026-06-05T08:04:29+00:00

I am executing a batch file from java program. When I execute from eclipse

  • 0

I am executing a batch file from java program.
When I execute from eclipse it works fine but when I make it a runnable jar it is not able to find the path of the batch file

I kept the batch file as a resource in the source directory.
When I print the path of the resource using Class.getResource(“/resource/mybat.bat”) it gives the path correctly as

  • resources/mybat.bat(jar creation option : package required library into generated jar)
  • file:/C:/Users/aasha.medhi/Desktop/myjar.jar!/resources/mybat.bat(jar creation option : Extract required libraries into generated jar)

If I extract the jar, the resources folder exist.

However when I try to run the jar, it gives “The system cant find the path specified error” for the batch file

I have gone through most of the links and tried out different options but without any luck.
I just need a way to create the runnable jar properly.Please help..

  • 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-06-05T08:04:30+00:00Added an answer on June 5, 2026 at 8:04 am

    While Java can read JARs and treat them just as the normal file system, most other applications cannot. In this case cmd can’t. You have to extract the batch to a temporary location and run it from there.

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

Sidebar

Related Questions

I'm trying to execute a simple batch file from java using Runtime.getRuntime().exec(command); but facing
I'm executing batch file from a C++ program by system(start /B mybatch.bat) call, where
I need to identify the P(rocess) ID of an executing batch file from a
I'm having two files that I've to invoke from a java program: a batch
I am trying to execute a batch file from C# code using Process class.
How can I automate executing a batch file from TeamCity. Can I create a
I am executing MSBuild from a batch file. The MSBuild script is in a
I am writing the batch file and executing it through C# program. Writing Batch
I have a batch file to execute a VB script. While executing the batch
When executing :make from vim, after make is complete it automatically jumps to 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.