Add a plugin to an installed eclipse rcp software without modifying config.ini - eclipse

I have an installed eclipse RPC application and I want to add a plugin to it which I just wrote. To acheive this I copied the new plugin into the plugin folder of my application and added the plugin to the list of plugins in the config.ini file found under \configuration\config.ini.
This works, but I don't like messing around with the config file. Is there a way to get new plugins working without adding them to the list or do I have to do this for every single plugin I create?

Have you tried to export is as a plugin and put the resulting jar files inside the dropins folder of your Eclipse RCP?

Related

Checkstyle: Custom Rules - Eclipse Plugin

I have written few custom checkstyle rules using checkstyle API. They run fine using Maven (after I add the new project as a dependency to the checkstyle plugin).
Now I want these rules to be used by the Eclipse Checkstyle plugin. And this is where I am stuggling.
I've downloaded the sample plugin project (as suggested here and here).
I do not understand what to do next after reading these links.
Do I need to export my project as a JAR?
How do I plug it into my existing Checkstyle plugin?
Thanks
You can do it like following :
Create plugin project and add your custom checks there.
Make appropriate changes to plugin.xml, checkstyle_packages.xml.
Export the project as Deployable Plug-ins and fragments (Export > Plug-in Developement)
Copy the jar file to Eclipse Plugin folde, so no need to install your custom check .
You can refer this tutorial
You already have the correct links that will eventually get you there. As for your questions:
All your custom checks can go into one JAR file. That JAR file must be an Eclipse plugin JAR. I simply install it by copying it to the Eclipse dropins folder, but there may be more elegant ways to do that.
So you end up with two plugins: The original, unmodified Eclipse-CS, and your own plugin which contains the custom checks. When both are independently installed in Eclipse, the Eclipse-CS configuration dialog will offer your custom checks for use in Checkstyle configurations.

Runtime error of NoClassDefFoundError when a eclipse plugin depends on other eclipse plugin

I have an eclipse plugin project com.prosseek.asttest, and I spin off a new plugin project com.prosseek.impactAnalyzer that has one class CallHierarchyGenerator.java. Now asttest project depends on impactAnalyzer project. I had no choice but to make impactAnalyzer project eclipse plugin as it uses JDT library.
After setting up the build path in com.prosseek.asttest, it builds without a problem.
However, when I execute the plugin, I got an error missing CallHierarchyGenerator.java class.
What might be wrong?
If you are running this as an OSGI or Eclipse Application, you need to explicity export packages as available to other plugins as by default they are not. Open your manifest editor in plugin 1. Click on the runtime tab and add the packages as "Exported" then the class loader in blugin 2 will be able to find it.
Also looks like you might be doing the class path configuration wrong. in plugin 2 make sure you add plugin 1 as a dependency in the dependencies tab of the manifest editor. Looks like you are doing a dependency configuration as if it were a regular java application
Based on Duncan's answer, I could fix this issue.
Export packages in impactAnalyzer
Actually I didn't add it manually, but it's already exported, as (I guess) I did it with Quick Assist automatically.
Required Plug-ins
I had to Add com.prosseek.impactAnalyzer in the dependecies.
Run configuration update
I had one more step to do, I had to open run configuration to add required plug-ins.
Export the plugin
When exporting the asttest plugin, I also had to export impactAnalyzer also.

Eclipse 3.7 Required Plug-ins

I am currently running Eclipse 3.7 Indigo
My current project is a Plug-in Project
I wanted to try out the product called icePDF in my existing project.
So I downloaded the two required jar files from the binary download.
icepdf-core.jar and icepdf-viewer.jar
So I created a new plug-in project from existing jars. I am added the two jar files and created the plug-in project. I then exported the project and produced a project jar file .
Went back in to my existing project where I want to use the features of icePDF.
Went to dependencies -> Required Plug-ins -> Added my new icePDF plugin.
I am sure that I am missing a key step. Because as soon as I close the icePDF project in Package Explorer. I get a error in my main project.
Error : Missing Required Plug-in
What I don't understand is I have at least 12 other required plug-ins, none of them are open.
Was this the right way to try and add the icePDF jars to my existing project? Was there a way to just incorporate the jars in to the plug-in project without having to create the new project?
EDIT
Looks like icePDF primarily uses Swing. My project is SWT based, I do not want to use Swing in the project. I am looking for something that will view a existing pdf, convert a pdf and print a pdf to local printer.
Any suggestions??
It is normal behavior that Eclipse reports an error when a required plugin is closed, if this plugin is only available through your workspace. I assume that the other required plugins are 'standard' Eclipse plugins, such as EMF; those do not have to be in your workspace, as they are directly installed into your Eclipse platform.
Another way would be to put the original Jars into your plugin project. Just create a folder, e.g. lib/, paste the Jars there, and add them to the plugin project's class path. The latter is a bit tricky, as you have to add them in the Project Properties as well as in the Manifest.ml (in the 'runtime' tab of the plugin.xml-editor, IIRC) and the build.properties file.
Please read about the Eclipse target platform, as you seem not to be aware of that concept.
Generally speaking, there is an Eclipse environment in which you develop your code (which you use), and there is another Eclipse environment, in which your developed plugin runs (i.e. which a user of your plugin uses). That second one is called "target platform" in Eclipse terms. And they can be different, e.g. you develop in Eclipse 4.2, but your plugins shall run in Eclipse 3.7.
If you don't create a target platform yourself, then Eclipse just assumes its current installation to be the target platform (i.e. your development environment). That is why all "normal" plugins can be used as dependencies without them being in the workspace. But your icePdf plugin is not part of the Eclipse installation (and therefore not part of the target platform), which is why it needs to be available in the workspace.
If you define a target platform, you can then simply add those icepdf plugins to it and don't need to have them in the workspace any longer.

add jar to eclipse plugin (hadoop)

I need to run an Eclipse (Indigo version) plugin, but from the error log I find out that I am missing 2 jars.
How can I add the missing jar to Eclipse so that I can run the plugin?
Is there a way to add the jar to the existing plugin?
If this is of any help, I try to run Hadoop Map/Reduce perspective and I found out that I should add commons-configuration and commons-lang.
The simplest way is to just copy the Jar file(s) into your plugin project, and then go to the plugin manifest (open the MANIFEST.MF file) and add them to the classpath on the Runtime Tab. Also on the Build tab, make sure they are checked so that they are included in the output of the plugin.
There are other ways, like making a special plugin to house only the required Jar files, or get the bundle (plugin) that might already contain that Jar file from someplace like Orbit.

Eclipse RCP: build product able to load all plugins in plugins directory

I need to configure my eclipse product to load all features/plugins in features/plugins directory. Now my product loads just plugins that are listed in metadata, so if I export some plugin directly from eclipse tool as "deployable plugins" it's loaded in my product, but if I put a plugin jar directly in plugins directory It doesn't appear (the same if I work with features)
I simply make new product configurations, put the feature that contains my application plugin and then exporting product I have this problem.
My eclipse version is 3.6.1
I think the problem is in the launcher configuration but I don't know what I have to change
In theory, your exported RCP application should simply pick up any new features and plugins you add later. However, make sure you put the extra stuff in the dropins folder of your RCP, since this is the expected location for manually installed features since the introduction of p2.
If for some reason it still doesn't work, try launching Eclipse with the -clean command line argument.
According to The Eclipse runtime options page, the -clean argument has the following effect:
[...] any cached data used by the OSGi framework and eclipse runtime will be wiped clean. This will clean the caches used to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.
In my experience this can resolve many mysterious cases, where newly added plugins are not loaded by Equinox.