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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:31:20+00:00 2026-06-10T06:31:20+00:00

I currently have a eclipse plugin with a view. Inside the src foler, there

  • 0

I currently have a eclipse plugin with a view. Inside the src foler, there is an icons folder which contains some images I would like to use in my plugin. Inside my program I use lines such as:

public static final Image anImage = new Image(null, "sample_image.gif");

And then proceed to use that image somewhere. This work when I run my program locally, but when I export my plugin to a jar, and then install it to a new Eclipse, the plugin breaks. When I take out the image usage in the code, the plugin works normally without the images. I’m wonder what the correct way is in order to get my images usable in the exported jar file for plugin installation.

I had a previous problem and SO question similar to this one, and someone suggested using Classloader.getResource(). I haven’t had much luck trying to get it to work, and it seems like it wouldn’t be necessary, as by default if you use a PDT generated Eclipse views plugin demo template, it comes with an icon folder that uses a “sample.gif”, which as far as I can tell, works fine.

Thanks for any suggestions.

  • 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-10T06:31:22+00:00Added an answer on June 10, 2026 at 6:31 am

    Typically you should use the icons folder approach. Ensure the folder is exported in the build.properties file (under the bin.includes section). If you use the MANIFEST.MF editor and tick the icons folder in the “Binary Build” section of the “Build” tab.
    The src folder is treated differently – it assumes there is code to compile and the compiled output is included, not the original folder.
    It “works” when running from an eclipse with the plugin in the workspace because the workspace directory is used instead of the compiled plug-in.
    You can load the image using the imageDescriptorFromPlugin from AbstractUIPlugin.
    For example use;

    Image img = AbstractUIPlugin.imageDescriptorFromPlugin("you.bundle.id", "/icons/sample_image.gif").createImage();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an Eclipse plugin which creates a view in Eclipse. Currently it
I have to reuse a major C++ project which is currently developed inside eclipse,
We're coding a Java6 project under Eclipse Indigo and we currently have some compilations
Currently, I have a machine on which I am working in Eclipse, it says
i'm currently working on a Eclipse RCP Project. I have a Plugin Fragment where
I have an Eclipse plugin where the user can select files or folders. Currently
I am currently developing a Java RCP with Eclipse RCP which has a plugin.xml
I have an Eclipse RCP application which uses some bindings from org.eclipse.ui.defaultAcceleratorConfiguration in addition
I'm trying to build an eclipse plugin view where I have a view that
I am currently using Eclipse to code a new plugin. I have been following

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.