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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:18:40+00:00 2026-05-12T16:18:40+00:00

I have these files board.class and x4.class (x4.class has main() method). To jar these

  • 0

I have these files board.class and x4.class (x4.class has main() method).

To jar these files, I wrote

jar cf x4.jar *.class

and got a x4.jar file.

I copied this x4.jar file to my Desktop (on windows Vista) and double-clicked it. I am getting this error:

Failed to load Main-Class manifest
attribute from
C:\Users\eSKay\Desktop\x4.jar

What should I do to make this file run as a jar executable (without installing any software)?


UPDATE:
I used a manifest file to fix the problem. I have got the jar file I needeed and it is running fine if you do:

java -jar x4.jar

But, when I double click x4.jar nothing happens, I checked Task Manager and found that a javaw.exe is being started in the background, but it is not showing the output the original program was giving.

What can the problem be?

  • 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-12T16:18:41+00:00Added an answer on May 12, 2026 at 4:18 pm

    You need to create a manifest file which contains the Main-Class attribute to specify its entry point. Then use the “m” flag in the jar command to specify it. For example, you might have a file called manifest.txt:

    Manifest-Version: 1.0 
    Main-Class: x4    
    

    Note that you need to have an empty line at the end of the file, or the jar tool won’t process it properly, ignoring the final line silently.

    Then run:

    jar cfm x4.jar manifest.txt *.class
    

    To test it, run:

    java -jar x4.jar
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
I have these two simple files that define a C++ class with a tryME
I have a python project with this directory structure and these files: /home/project_root |---__init__.py
Say I have all these files in a folder: something(34324).php something(34).php something(3433454546).php something(65565).php something(9887).php
Do both these files have the same content? Or do they provide different functionality
I have a folder with these files: alongfilename1.txt <--- created first alongfilename3.txt <--- created
I have 4 files sorted alphabetically, A, B, C, and D. These files contain
I have a dozen configuration properties files for the ant script. These files are
I have two excel files. Among many columns in both these files, they have
I have a folder of PHP files. The source code to these files is

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.