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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:23:04+00:00 2026-06-16T15:23:04+00:00

I write a very simple java program with two classes: Business and Main .

  • 0

I write a very simple java program with two classes: Business and Main.

I want to create a jar such that if I email it to someone they can:

  • run the program (i.e. run the jar)
  • open the jar to view the source code.
  • the code can run on mac or windows

I have been using IDEs for so long I have forgotten how to do this.

I am using netbeans 7.x

EDIT:

I found the following way on Netbeans:

properties > packaging > exclude from jar file :: delete **/*.java

But when I try to execute the jar using

java -jar mybusiness.jar

it says

no main manifest attribute, in mybusiness.jar

But note that my jar has a main class. Am I missing a manifest 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-16T15:23:05+00:00Added an answer on June 16, 2026 at 3:23 pm

    You can export a JAR file that includes the source code using Netbeans:

    1. Right click on the project and select properties
    2. Build -> Packaging
    3. Remove Java files from the excluded files. And select build jar after compiling

    It will create the jar file that includes the source code if it successfully compiles.

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

Sidebar

Related Questions

i am trying to run a very simple java program. i want to write
I'm trying to write a very simple program, I want to print out the
I want to write a very simple game in Java to demonstrate a wireless
I want to write a very simple implementation of an onion router in Java
I want to write a very simple script , which takes a process name
I am trying to write a very simple web-based email client from scratch with
I'm trying to write a very simple image processing program for fun and practice.
I've got a very simple java program (J.java, see below) on my application server
I'm trying to create a Java program that writes files for my Adruino to
I'm currently attempting to write a simple python program that loops through a bunch

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.