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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:30:44+00:00 2026-05-14T05:30:44+00:00

I have created a JAR file in this way jar cf jar-file input-files .

  • 0

I have created a JAR file in this way jar cf jar-file input-files. Now, I’m trying to run it. Running it does not work (jre command is not found):

jre -cp app.jar MainClass

This does not work either:

java -jar main.jar

(Failed to load Main-Class manifest attribute from main.jar).

I also found out that

To run an application packaged as a
JAR file (version 1.2 — requires
Main-Class manifest header)

What is the “Main-Class manifest header”? How do I create it and where do I put it?

  • 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-14T05:30:45+00:00Added an answer on May 14, 2026 at 5:30 am

    I’m not sure I believe your symptoms:

    • If the jre command isn’t found, then running jre -cp app.jar should give the same error
    • Just adding a JAR file to the classpath shouldn’t give the error you’re seeing

    I’d expect you to see this error if you run:

    java -jar app.jar
    

    The Main-Class header needs to be in the manifest for the JAR file – this is metadata about things like other required libraries. See the Sun documentation for how to create an appropriate manifest. Basically you need to create a text file which includes a line like this:

    Main-Class: MainClass
    

    Then run

    jar cfm app.jar manifest.txt *.class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created jar file for my project. It is running successfully. There is
I have created a java application and packed it into a jar file on
I have recently just created Java project using Eclipse that requires 2 JAR files
I have created a bat file which calls selenium server called run-selenium-server.bat which has:
YUI Compressor does not accept wildcard parameters, so I cannot run it like this:
I have created a file with XmlDocument xmldoc = new XmlDocument(); Can I make
SOLUTION : I have figured out a work around for this problem. I ran
I have hundreds of jar files scattered across different projects that I need to
I have created an executable JAR with the manifest: Manifest-Version: 1.0 Main-Class: MyClass Class-Path:
I have created a plugin project in Eclipse, distributed as a jar. The user

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.