Exporting plugin from Eclipse, how can I test it? - eclipse

If I export a plugin from Eclipse using the 'Export -> Deployable Plug-ins and Fragments' as a jar file. I was wondering how I can then use this plugin in my workspace after I restart Eclipse. Are there any additional steps I need to perform to use the plugin?

Just copy it into the dropins folder of Eclipse. Do not use the plugins folder directly as there is a good chance it won't be picked up.

Put the JAR in a folder named dropins/eclipse/plugins under your target eclipse directory.
An easier method to install it is to select 'install into host' when you export the plugin.
For testing purposes you shouldn't have to use the dropins folder, but instead launch it as an eclipse plugin.
Depending on the type of plugin you have created you may need to click a button or hotkey to activate it.

Related

where is eclipse dropins folder

i just downloaded eclipse 2019-03 (4.11.0), and need to install google-java-format plugin, according to the instruction I need to put the google-java-format Eclipse plugin to eclipse dropins folder, i looked around there is no such a folder, by google around I decided to manually create this folder now the folder directory looks like this
/Users/ddd/eclipse/java-2019-03
/Eclipse.app
/dropins
google-java-format-eclipse-plugin_1.6.0.jar
then i restart eclipse and tried to configure the java code formatter to use google java format:
seems like the plugin was not picked up by eclipse, did I put the dropins folder at the wrong place?
On macOS it is inside the Eclipse.app in the 'Contents/Eclipse' folder alongside the features and plugins folders. In Finder you have to use 'Show Package Contents' on the Eclipse application to see the folder structure inside the app.

Eclipse Kura OSGi Dependency Management

Preface: I'm new to Eclipse, OSGi, and Kura
I'm trying to develop a Kura plug-in that depends on org.apache.httpcomponents.httpclient. I found an OSGi bundle for the package here.
Currently, the only way I'm able to use the plug-in (with the OSX Kura emulator) is to download httpclient-osgi-4.5.jar and add it to ~/Documents/workspace/target-definition/common/repository/plugins/. Otherwise I get a class not found error.
When I add the plugin to MANIFEST.MF either as with REQUIRE-PLUGIN or IMPORT-PACKAGE, Eclipse cannot find the package.
What's the correct way to require, fetch, and add to the classpath a remote dependency using Eclipse Kura/OSGi? Eclipse currently only looks in my local workspace for dependancies, is there an accepted way to fetch remote plugins?
Thanks for the help!
The bundles located in target-definition/common/repository/plugins are part of an M2 repository created by the Kura build. It is not enough to simply copy your required bundle to that directory. The solution I typically use to accomplish what you want is:
Double click the kura-equinox_3.8.1.target file located in target-definition. This should open in the Eclipse IDE.
Under "Locations", click "Add...". Then select "Directory" and "Next". Select the folder containing your required additional bundles and click "Finish".
Save the kura-equinox_3.8.1.target file and click "Set as Target Platform". Your new bundle should now be available in Eclipse.
Thanks,
--Dave
What for me works is;
Simply copied the bundle in ${workspace_loc}/target-definition/common/repository/plugins
Clicked on reload
Clicked on Set as Target Platform
After these steps, Eclipse is aware of my bundle and could able to use it anywhere.

Eclipse - why cant it integrate jars in lib folder into project?

I manually copy needed jar files into my project lib folder. Then, I try to add them to build path via "configure build path option". If i choose "add jar", then the lib folder does not show up in the "to choose from" list. So, I am forced to use "add external jars" option instead. But, that option does not make the jars a part of the project even though they lie in the lib folder. After I restart eclipse 2-3 times, the jars are magically integrated into my project.
Why is eclipse behaving this way ? Why can't I do this easily ?
Please help me.
By default, Eclipse dose not detect file change which come from outside, like copy a jar file in lib folder manually.
So after you copied jar files, you have to refresh the project by pressing F5 while selecting your lib folder. I believe that's why eclipse cannot found your jar files.
If you want to solve this problem once for all, you can active "Refresh using native hooks or polling" via
Window -> Preference -> General -> Workspace
However, this might slow down Eclipse if you have a big project with many many files.
UPDATE
As Bananeweizen mentioned, instead of doing all the copied from outside of Eclipse, you can also copied those file into Eclipse, Package Explorer View for example. This way Eclipse will detect and refresh folder automatically.
The way I was taught to add external jars to an eclipse project is to drag the jar file from explorer into the lib folder in eclipse and then on the dialogue eclipse responds with is choose the copy to option and eclipse imports the jar file and copies it to the lib location at the same time.

How to manually install software/plugin to Eclipse IDE?

I have downloaded a RAR file from the following location, to be (manually) installed to Eclipse (Helios). How can I perform the manual installation?
http://sourceforge.net/projects/eclipsesql/files/SQL%20Explorer%20RCP%20%28exc%20JRE%29/3.6.1/sqlexplorer_rcp-3.6.1.macosx.cocoa.x86.tgz/download
Instead of putting it directly into the plugins directory, it's better to use the dropins directory as this was created just for this purpose. Have a look here: http://wiki.eclipse.org/Equinox_p2_Getting_Started#Dropins
For sqlexplorer: do not download the full RCP version (as your link does), this one is standalone. Get this one instead: http://sourceforge.net/projects/eclipsesql/files/SQL%20Explorer%20Plugin/3.6.1/sqlexplorer_plugin-3.6.1_SR2.zip/download
Extract this to $eclipse_home$\dropins\sqlexplorer and restart Eclipse.
BUT: Using the SqlExplorer Update Site (http://eclipsesql.sourceforge.net/) would be an even better option (Help>Install new Software)
I have tried the installation with the explanation about the dropins folder and had to tweak it like that:
Unzip the distribution into your eclipse installation directory under the folder dropins. Your structure should be:
eclipse/
dropins/
eclipse/
features/
plugins/
Remove all other files and directories. There is some missing piece (file contents.xml), so that the distribution is no real p2 repository which leads to an error. The directories plugins and features are sufficient.
Restart your eclipse (I have done it with option -clean, not sure if that is necessary).
SQLExplorer is then installed and visible in the help, in different menus and with a new perspective.
I even was able to use it to have a look at my SQLite3 database of a rails3 application. Wow!! So I will give it a try.
From their website (http://www.sqlexplorer.org/):
Eclipse Plugin
Download
Download the Eclipse SQL Explorer plugin and extract the zip file in your eclipse directory (requires Eclipse 3.3 or better).
After restarting eclipse with the -clean option, a new SQL Explorer perspective should be available.
Eclipse Update Site
You can install and update Eclipse SQL Explorer via the eclipse update mechanism. The update site for Eclipse SQL Explorer is http://eclipsesql.sourceforge.net/
I always go for the update site option if they present it, it's easier and lets you do updates easily. To use the update mechanism just select Help > Insall New Software... then enter the update site, press Add and go through the wizard.

Installing a plain plugin jar in Eclipse 3.5

Since Eclipse 3.5 there seems to be no option to have drop a plugin jar ( not a feature ) in the Eclipse base directory and have it picked up at next startup.
Is there any possiblity to have plain plugins jars installed in Eclipse 3.5?
Since the advent of p2, you should be using the dropins directory instead.
To be completely clear create "plugins" under "/dropins"
and make sure to restart eclipse with the "-clean" option.
Simplest way - just put in the Eclipse plugins folder. You can start Eclipse with the -clean option to make sure Eclipse cleans its' plugins cache and sees the new plugin.
In general, it is far more recommended to install plugins using proper update sites.
For Eclipse Mars (I've just verified that) you to do this (assuming that C:\eclipseMarsEE is root folder of your Eclipse):
Add plugins folder to C:\eclipseMarsEE\dropins so that it looks like:
C:\eclipseMarsEE\dropins\plugins
Then add plugin you want to install into that folder:
C:\eclipseMarsEE\dropins\plugins\someplugin.jar
Start Eclipse with clean option.
If you are using shortcut on desktop then just right click on Eclipse
icon > Properties and in Target
field add: -clean like this: C:\eclipseMarsEE\eclipse.exe -clean
Start Eclipse and verify that your plugin works.
Remove -clean option from Target field.
go to Help -> Install New Software... -> Add -> Archive.... Done.
in Eclipse 4.4.1
copy jar in "C:\eclipse\plugins"
edit file "C:\eclipse\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info"
add jar info.
example:
com.soft4soft.resort.jdt,2.4.4,file:plugins\com.soft4soft.resort.jdt_2.4.4.jar,4,false
restart Eclipse.
This is how you can go about it:
Close Eclipse
Download a jar plugin (let's assume its testNG.jar)
Copy testNG.jar to a certain folder (say C:\Project\resources\plugins)
In your Eclipse installation folder, there is a folder named dropins (could be C:\eclipse\dropins), create a .link file in that folder, (like plugins.link)
Open this file with any text editor and enter this one line:
path=C:/Project/resources/plugins
Save the file and start Eclipse.
And you are good to go!
Please do not forget to change your backward slashes in your plugins folder path to forward slashes on step 5. I used to forget and it would take my time unnecessarily.