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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:25:15+00:00 2026-06-15T08:25:15+00:00

My jar file P2.jar (which has a main method and manifest file) is located

  • 0

My jar file P2.jar (which has a main method and manifest file) is located in C:\Jar Folder. I tried to run it from cmd like this:

C:SomeRandomFolder> java -jar C:\Jar Folder\P2.jar

I get the error:

unable to access jarfile C:\Jar

It works when I run it from the folder that the jar is in like this:

C:\Jar Folder> java -jar P2.jar

Why can’t I use the 1st command? Why do I have to go to the directory of my jar file?

  • 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-15T08:25:16+00:00Added an answer on June 15, 2026 at 8:25 am

    That’s because of the space you have in the path name. On Windows, use quotes:

    java -jar "C:\Jar Folder\P2.jar"

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

Sidebar

Related Questions

I'm using ASANT to run a xml file which points to a NARS.jar file.
I have a jar file of my application which has more than one class.
I have an application which has a font stored within a jar file. It
Can we run an executable jar file containing Java3D API on a computer which
My professor has decided to provide an external jar with a main method for
I'm trying to run a java program from a jar file. Java can't find
I have an html file which has a jar file included in it as
I have a JAR with 4 classes, each one has Main method. I want
i generate a WAR file which has a jar named xyz.jar inside its WEB-INF/lib
For our Kunagi Java web application we have a signed kunagi.jar file which contains

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.