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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:48:24+00:00 2026-05-25T21:48:24+00:00

Let us have a Java application, contained in files A.java and B.java with dependency

  • 0

Let us have a Java application, contained in files A.java and B.java with dependency on somejar.jar file. The questions are:

  • how to create a self-runnable JAR file with all the dependencies and sources compiled within? The main condition is using the standard Java utilities only (given with JDK; e.g.: java, javac and jar) and NOT any of build tools like Maven, Ant or any other.

  • how to use external JAR files within my application? For example, the algorithm is: if the 'otherjar.jar' is present near the main application JAR, we should call method Moo::method1 from that class, passing the new instance of Foo class to it. Moo and Foo should be present in 'otherjar.jar' file. Still, the 'config.xml' file should be there too.

  • 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-05-25T21:48:24+00:00Added an answer on May 25, 2026 at 9:48 pm

    From the link that @michael667 gave, you may be more interested in this section: Adding Classes to the JAR File’s Classpath. In particular this note:

    Note:
    The Class-Path header points to classes or JAR files on the local network, not JAR files within the JAR file or classes accessible over internet protocols. To load classes in JAR files within a JAR file into the class path, you must write custom code to load those classes. For example, if MyJar.jar contains another JAR file called MyUtils.jar, you cannot use the Class-Path header in MyJar.jar’s manifest to load classes in MyUtils.jar into the class path.

    It’s not a possible thing to do with the standard java tools if you don’t code your own classloader. There are tools out there, like One-jar which can provide you of such classloader.

    Of course, you could always manually use the exploding-jar approach, but that doesn’t seem to be what you really want.

    You may also find the answers to this question useful: Classpath including JAR within a JAR

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

Sidebar

Related Questions

Let's say I have an existing application written in Java which I wish to
I have an application contained in A.JAR. This jar has several dependencies so they
Let me describe my question - I have a Java application - Hibernate as
I have a java application launched by a .cmd file. I want to set
Let's say that you have a standalone application (a Java application in my case)
Let's say I have a running Java-based web application with 0 or more valid
I have a distributed Java application running on 5 application servers. The servers all
I have an application that uses several configuration files (let just consider appli.properties here).
Imagine the next architecture: We have Java application over Spring framework (let's call it
I have a Java Swing application that i want to create a nice component

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.