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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:13:45+00:00 2026-06-02T07:13:45+00:00

I want to create a runnable JAR that include referenced libraries, namely jackson ,

  • 0

I want to create a runnable JAR that include referenced libraries, namely jackson, in eclipse via the export. There used to be fat jar that seemed to be the goto solution before Eclipse offered to export to runnable JAR.

From this question, the first option would be what I’m looking for. Since it is for the moment a small project, it wouldn’t be a problem to always have everything together (plus it’s easier for me since I’m just starting with JARs, runnables and jnlp)

When I try to launch it, there’s an alert window saying there was a problem and to try to find it in the console (which I can’t get to open).

If I remove any use of this referenced library everything runs perfectly (except the part that it’s not doing what I want at all). The window looks the way I designed it, but no functionality without the library.

I don’t even have a stack trace to help with the problem. I’ve created other projects without any referenced libraries and everything is fine. So I’ve pretty much narrowed it down.

Since I let Eclipse handle the exporting and everything, I don’t suppose you need the manifest to see if it is alright. Any questions you might have, I’ll provide the informations you need. It goes without saying that the project runs directly from Eclipse.

Eclipse
Version: Indigo Service Release 2
Build id: 20120216-1857


Edit following Baqueta‘s answer

What happens when I do that is that I get a custom RuntimeException. I’m a bit baffled here. Here’s a simple explanation of my code.
I have a utility class (UtilityJSON) that uses the referenced library (jackson). The constructor of that utility class instantiate an object defined in the referenced library, let’s call it mapper.
A method of UtilityJSON uses a method of ‘mapper’. At this point the exception is raised. Why I’m baffled is that ‘mapper’ is succesfully instantiated but using its method raises an exception. If the jar couldn’t find the referenced library, it probably couldn’t create the object ‘mapper’. But running the project from Eclipse is all fine.
Is there any way to debug when running an executable jar? Maybe echo something in the console.


Edit 2

I may have found the error. My program reads a *.txt file in a folder inside the project. When exploring the content of the jar I see that this folder was not included, thus the exception. So the question now becomes: how do I include this folder? It’s in the root folder of the project.

  • 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-02T07:13:48+00:00Added an answer on June 2, 2026 at 7:13 am

    You could try the following:

    1. In Eclipse, go to Project->Properties.
    2. Select ‘Java Build Path’ from the column on the left.
    3. Select the ‘Order and Export’ tab.
    4. Find ‘jackson’ in the list and make sure it’s checked.

    EDIT
    To answer your updated question:

    In Eclipse, find the *.txt file in the Package Explorer. Right-click it and select Build Path->Add to Build Path. Then follow the instructions above to make sure the file gets included in the Jar. Finally, do a clean and rebuild.

    If you’re ever going to add more resources, it is common practice (and makes sense!) to have a resources folder (often called ‘res’). You can then add the entire folder to the build path, so that all the resources in there get included in the Jar.

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

Sidebar

Related Questions

I have an ant script that creates runnable jar and I want it to
I want to create an app that is only runnable on one machine (PC).
I am trying ebook reading app. In that I want create UIActionSheet by clicking
I want to create a bookshelf that tiles horizontally and vertically. I have three
I want to create a background Thread handling some tasks (Runnable) and executing them
I have a class,which implements Runnable interface. I want to create multiple threads for
I want to programmatically start HSQLdb server. I create a runnable like below and
I want to create an app that uses the internet and I'm trying to
I want to create a simple server client application, but i think there is
I want create a drop shadow around the canvas component in flex. Technically speaking

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.