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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:02:35+00:00 2026-05-18T01:02:35+00:00

In a normal java application its possible to print the content of the classpath

  • 0

In a normal java application its possible to print the content of the classpath with:

String ss = System.getProperty("java.class.path");
System.out.println(ss);

But how do I print the classpath of an OSGI bundle created using the eclipse PDE wizard? In the activator its possible to get the current bundle like:

public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;

Bundle b  = context.getBundle();
 // java doc: This bundle's class loader is not used to search for entries. 
b.findEntries(path, filePattern, recurse)

But the javadoc says that the findEntries does NOT use the class loader. Is there any simple way to see/prints what is on the current bundle’s classpath?

  • 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-18T01:02:36+00:00Added an answer on May 18, 2026 at 1:02 am

    As others have indicated there is really no such thing as a “bundle classpath” – that’s the whole point of OSGi. 🙂

    What you can do is:

    • look at your bundle’s headers to see which packages it imports, and whether they are required or mandatory

    • use PackageAdmin to find bundles that export packages with a given name

    However AFAIK PackageAdmin is deprecated and there will be a new/extended mechanism to work with bundle wiring in 4.3.

    It seems like your real motivation for this is classpath scanning to find & load resources. The fact that this is not easily possible is a side effect of enforcing module boundaries: you can’t have a fence and at the same time allow anyone to walk on the lawn.
    There was a plan for a standard service that scans bundles on behalf of a client, but that seems to have been withdrawn (not sure why – maybe as consequence of the new 4.3 stuff).

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

Sidebar

Related Questions

Signed Java Applets have the same security clearance as a normal Java application running
I am starting a normal Java SE project and i am planning to use
Under normal circumstances, a VB.NET application of mine can check the ClientName environmental variable
Consider a normal customer-orders application based on MVC pattern using WinForms. The view part
I'm writing a Java application that will have an on-screen number pad available for
Here's the deal. I'm just starting with Java programming, I've made a simple application
I have troubles using the java ServiceLoader in a NetBeans module application. Here is
I've been trying to use Java's ProcessBuilder to launch an application in Linux that
I'm using PDF-Renderer to view PDF files within my java application. It's working perfectly
I have a bit of a problem. I have a java application and when

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.