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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:35:42+00:00 2026-05-11T10:35:42+00:00

I write Eclipse plugins and export some classes as an API while wanting to

  • 0

I write Eclipse plugins and export some classes as an API while wanting to restrict access to other classes.

I follow the common Eclipse practice of separating these classes into a ‘.internal’ subpackage.

However, then I can’t use ‘package’ or default level access on these classes since many of them need to be used by the classes I’m exporting.

What is the best practice for preventing or discouraging users of my API from using these classes for their own purposes? Is there an automatic checker?

I admit that I’ve dabbled in using some of Eclipse’s internal classes when I had no choice 🙂

Clarification: I have a similar need with non-plugin code.

  • 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. 2026-05-11T10:35:43+00:00Added an answer on May 11, 2026 at 10:35 am

    Isn’t it just a case of updating the META-INF/MANIFEST.MF to being a plug-in osgi project (if it’s not already?). It should look something like:

    Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: My-plugin Bundle-SymbolicName: com.mycompany.mypluginname Bundle-Version: 1.0.0 Bundle-Vendor: MyCompany Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Service-Component:  Import-Package: org.apache.log4j;version='1.2.14' (, separated etc) Export-Package: com.mycompany.mypluginname.myapipackage;version='1.0.0' 

    And then nicely omit the .internal package. The platform should do the rest.

    By the way, you then use the Import-Package: in any dependent bundles, plugins etc, rather than depending on the jar/project (which is the old, sucky way which doesn’t work – as you’re finding).

    This gives you massive de-coupling of your code dependencies. If you decide that your plugin code should belong in a different jar/bundle, you just move individual packages, and make the new bundle/plug-in export it. Since the client bundles just import the package from ‘the cloud’ (cloud being the OSGi platform), you can move code a lot more freely.

    Note: As mentioned in the comments, you don’t need to be running your apps in OSGi to get this ‘benefit’. Eclipse can compile it’s code under OSGi package restrictions, and your build/server can run in ‘the unprotected world’. e.g. the OSGi manifests don’t enforce anything to 3rd parties (who wish to use .internal), but provide ‘notifications’ and restrictions to those that want them.

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

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

I have a couple of native applications written in C++ and C#. These are
Some Eclipse plugins are mandated by your environment. The appropriate source code management plugin,
Is it possible to make the default Eclipse Generate hashCode() and equals() use getters
With Eclipse 3.4, is it possible to provide an ADDITIONAL plugin directory from command

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.