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

  • Home
  • SEARCH
  • 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 8539585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:24:02+00:00 2026-06-11T11:24:02+00:00

I know how to create a JAR file with the source code with maven,

  • 0

I know how to create a JAR file with the source code with maven, and also create an executable JAR. But my question is if there is any way of creating an executable JAR (so it contains all the .class files) that also contains the source code (so for each .class its corresponding .java file).

I want this for debugging with eclipse since my maven project is a library for another project and when debugging the bigger project I loose track when the execution reaches my library because the source code is missing in the JAR. I’ve found a solution among this forums that suggests to create two jars, one executable and another with .java files and set the source path in the IDE to point to the code JAR, but I would like to work with a unique JAR instead of two. Is that possible? if not with maven with another java tool? For instance merging both JAR files?

Lots of thanks.

  • 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-11T11:24:03+00:00Added an answer on June 11, 2026 at 11:24 am

    You can declare your source directory as additinal resource directory

    <build>
        <resources>
            <resource>
                <directory>${project.build.sourceDirectory}</directory>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
    </build>
    

    This will place the java files next to the class files – I do not know if your IDE supports debugging with this structure. Usually @Brian Agnew suggested way is the way to go.

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

Sidebar

Related Questions

Does anyone know the way to hide public classes in JAR file. In other
I'm new to Scala and don't know Java. I want to create a jar
I know I can create a List<T> from IEnumerable<T> by doing myEnumerableCollection.ToList() , but
I am trying to go through the process of creating a jar file from
I am trying to create and use jar file in an Android project under
Anyone out there used MATLAB's javaObject() function with a JAR file that uses JNI?
I would like to determine the jar file name from my java code. I
I have a .jar file I'm putting together. I want to create a really
i want to create a jar file in which i want to place some
I have seen this question, and have some more doubts regarding creating a jar

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.