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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:46:58+00:00 2026-05-17T20:46:58+00:00

I know this is a very common question, but I tried googling and got

  • 0

I know this is a very common question, but I tried googling and got no helpful result.
I’m trying to make a jar out of my “Main.class” file (made in NetBeans, but I’m not trying to make the jar with it)

I ran this command:

D:\NetBeans\trovanum3\build\classes\trovanum3>jar cf trovanum.jar *.class

And a .jar file spawned in that folder. I thought that would’ve worked, but it won’t run.

I tried opening the jar file with an archive opener and inside it are the “Main.class” file and a “META-INF” folder containing a file named “MANIFEST.MF”
The file contains this:

Manifest-Version: 1.0
Created-By: 1.6.0_22 (Sun Microsystems Inc.)

What could be the problem?

  • 1 1 Answer
  • 1 View
  • 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-17T20:46:59+00:00Added an answer on May 17, 2026 at 8:46 pm

    You can use the -e option of jar to specify the entry point, i.e. the main class. For example:

    D:\NetBeans\trovanum3\build\classes> jar cfe trovanum.jar trovanum3.Main trovanum3\*.class
    

    Saves fiddling with the manifest if that’s all you need in there. Note the working directory is one up from that quoted in your question. Otherwise the Main class is created at the top-level in the jar, rather than in a directory that reflects the package in which it should reside. jar -tvf should then show something like this:

      0 Thu Oct 21 22:34:30 BST 2010 META-INF/
     80 Thu Oct 21 22:34:30 BST 2010 META-INF/MANIFEST.MF
    488 Thu Oct 21 22:18:24 BST 2010 trovanum3/Main.class
    

    -e

    Sets entrypoint as the application
    entry point for stand-alone
    applications bundled into executable
    jar file. The use of this option
    creates or overrides the Main-Class
    attribute value in the manifest file.
    This option can be used during
    creation of jar file or while updating
    the jar file. This option specifies
    the application entry point without
    editing or creating the manifest file.

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

Sidebar

Related Questions

I know this is very common question but I am really stuck in this
HI, I know this is a very common question in case of .Net, but
I know this is a very common question. But I've looked through SO and
I know this is a very common question, but I would like to know
I know this is a very common question, but I could not find the
I know this question is very common but the main point in my question
I know this is a very broadly scoped question, but what do I need
guys I know this question is very basic but I've met in few publications
Ok, I know this is a very basic question, but my head is swimming
I thought this could've been a common question, but it has been very difficult

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.