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

The Archive Base Latest Questions

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

So, I have two jar files. Foo.jar, and Bar.jar. Bar.jar has a Main.class holding

  • 0

So, I have two jar files. Foo.jar, and Bar.jar.

Bar.jar has a Main.class holding

public class Main {
    public static String bob(){
       return "bob";
    }
}

And then in Foo.jar, i want to be able to access the “bob” method, without including the jar as a library or resource or anything like that.. It’s just going to be a completely separate jar.. Is that even possible..?

Sorta like this

System.out.println(BarAsJarFile.Main.bob());
  • 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-16T07:41:14+00:00Added an answer on June 16, 2026 at 7:41 am

    I don’t understand why you cannot set the classpath when you start the JVM (you can easily include multiple jar files that way), but it is possible to add jar files to your classpath later programmatically.

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

Sidebar

Related Questions

I have two files: Calc.java public class Calc { public int add(int a, int
I have two .jar files having same package structure and same class name. Eg.
I have two jar files. MyProduct.jar (The business logic) MyProductFixture.jar. (The fixture that calls
I have two wars, foo.war and bar.war. foo uses classes from bar. I'm trying
I have two jar files (Lets say jar1 and jar2). There is one xml
I have two jar files - jar1 and jar2. Both of them are located
Should be kind of trivial but say I have two jar files in libA.jar
I have two projects and each project has Spring XML files in their respective
Now I have two .jar files: one is a chat Client and the other
I need to setup LookAndFeel Files in JDK 1.6. I have two files: napkinlaf-swingset2.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.