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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:16:45+00:00 2026-06-13T10:16:45+00:00

When I clean and build, Netbeans generates a .jar file for my Java project,

  • 0

When I clean and build, Netbeans generates a .jar file for my Java project, and it uses a “lib” folder which has all of my external Jar files that I use. Can I somehow tell Netbeans to package these Jar files into the .jar it makes? So that I can run my project as a stand-alone .jar file?

I am using Netbeans 7.1.1 on Mac OSX

  • 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-13T10:16:46+00:00Added an answer on June 13, 2026 at 10:16 am

    The short answer is no, the long answer is complicated.

    Firstly, Java does not support embedded Jars (ie, you cann’t simply add the depended Jars into the main Jar).

    Secondly, uncompressing all the Jars and merging them into one will overwrite any resources/classes that share the same path/name. This may not be an issue in small projects but is a major issue in large ones (we have this problem with the project I’m working on at work).

    One solution is to use something like One-Jar, which basically uses it’s own boot class loader to all you to reference Jars inbedded within a single Jar.

    I’ve had issues with this when using our own custom classloader, but otherwise it seems to work well.

    It includes Ant support, so you can include it in your projects Ant build script, if you not using Maven, otherwise, you’ll need to devise your own build process

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

Sidebar

Related Questions

When I clean and build a project in NetBeans, the .jar file appears in
I was wondering about the difference between the build/clean&build in c++ project in netbeans
I have a Jenkins build which builds a maven project with -PmyProfile clean package
I have a Java EE 6 Project in Netbeans 7 which runs fine when
In Netbeans I've selected the 'build and clean' option on my project, however if
I am using NetBeans to build my executable JAR and haven't messed around with
I am looking for a way to export a .jar file in Netbeans. I
I'm trying to convert a Netbeans 6.9.1 project into a scripted build (without netbeans).
I am using netbeans 6.8: Product Version: NetBeans IDE 6.8 (Build 200912041610) Java: 1.6.0_18;
It has always been a clean build process till today. Checked in some source

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.