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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:41:37+00:00 2026-05-21T04:41:37+00:00

Question Given a Classpath Container I’ve written as a plugin/extension, how do I add

  • 0

Question

Given a Classpath Container I’ve written as a plugin/extension, how do I add it to the classpath, automatically?

Background

Ok so I’m an experienced Java Developer but extremely new to writing Eclipse Plugins. I’ve been googling, following tutorials and reading source code of other plugins for a couple days. I know exactly what I want to do but not exactly how to do it.

Right now, in Eclipse, when I click a resource and choose “Run as JUnit test” as in:


for some reason, my pics don't work anymore. I'll fix this soon...


Behind the scenes, the m2eclipse plugin somehow generates a run configuration that contains the “Maven Dependencies” classpath container, like the following:

alt text

My best guess is that the “Maven Dependencies” classpath container is added through some extension point being used by the M2Eclipse plugin. Similarly, I want to add my classpath container, automatically, whenever a user runs a JUnit test–so it shows up under “User Entries.” What extension point(s) can I use to make something like that happen? I’ve been looking at org.eclipse.jdt.core.classpathContainerInitializer but I’m not sure that’s going to do what I need.


Ideal Result

Ideally, I’d like to write a plugin that takes every entry in the project’s build path and adds it to the classpath of a run configuration (whenever a new launch configuration is created via: Run As > JUnit test). This should be the default behavior of Eclipse but it’s not!

My next-best solution would be to simply add my custom classpath container to the run configuration’s build path, automatically. At the end of the day, I just want one classpath for any java code our team runs/launches. This shouldn’t be so hard!

Any advise on how to achieve any of this would be appreciated! Even basic pointers on where to look to understand how particular Extension Points are intended to be used (the basic JavaDocs APIs are terrible). Thanks,

  • gMale
  • 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-21T04:41:38+00:00Added an answer on May 21, 2026 at 4:41 am

    Roostergx provides part of the answer (i.e., how to create the classpath container). The second part, as you admit, is how to add it automatically.

    I would recommend using an extension point called org.eclipse.ui.startup. This allows you to contribute code that runs (pretty much) as early as possible when Eclipse starts up. On every startup, you can iterate through all projects and see if any existing projects require the classpath container that you created.

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

Sidebar

Related Questions

I posted this question: https://stackoverflow.com/questions/418597/java-and-net-for-php-programmer and the answers I was given didn't really help
This is not a technical question, but given that there are a few iPhone
I've got this small question - given a bitmask of weekdays (e.g., Sunday =
Question Using XSLT 1.0, given a string with arbitrary characters how can I get
This was an interview question. Given Visual Studio 2008 and an icon saved as
In this question , I was given a really cool answer to alternating an
This is a purely theoretical question. Given three simple classes: class Base { }
I'm sorry for this very newbish question, I'm not much given into web development.
This came up when answering another user's question (TheSoftwareJedi)... Given the following table: ROW_PRIORITY
Question: Given an image in PNG format, what is the simplest way to programmatically

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.