Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse plugin works when debugging but not when installing

I wrote an Eclipse plugin that presents a right click menu option on any file or folder (for example, in navigator view). For each file selected (and for each file inside of a selected directory), the plugin computes and displays the MD5, SHA-1, SHA-256, SHA-384, or SHA-512 hash of the file. The plugin works perfectly when I debug while developing.

If I make the site using site.xml, put it on my server, and then install to Eclipse (it installs just fine), I see the menu. I can compute and display the hash for a selected file, but it just won't work for a selected folder. Absolutely nothing has changed in the code; it always works in debug mode, and it never works when I install it.

My question is this: how can I debug this? At first, I thought Eclipse's workspace/.metadata/.log file would offer some clue, but no error is output. I even went so far as to try adding some code in that writes a file to the desktop, but that file never gets created. Does anyone have any clue what is going on or how I should go about fixing this? I've never had such a hard time debugging before!

For reference, https://github.com/gfairchild/eclipse-hasher is the project. All source code is viewable there (it can be imported as an Eclipse project).


The answer ultimately involved 2 things:

  1. I wasn't including the lib directory during the build process. The dependency I use (Apache Commons Codec) wasn't included, so of course it wouldn't run.
  2. During the testing process, I had tried manually putting a build of Hasher into eclipse/plugins. I incorrectly assumed that if I uninstalled Hasher through the Eclipse interface, this file would be removed. It wasn't. So for the last month, I've had a stale version of Hasher being loaded into Eclipse. That's incredibly frustrating. Oh, well. Lesson learned.

Thanks very much to everyone that offered help!

like image 737
Geoff Avatar asked Dec 29 '25 01:12

Geoff


1 Answers

It's possible that you first tested your plugin in target platform with just the IFIle specific extension and added IFolder later, but the updated plugin wasn't loaded to Eclipse because you didn't increase the version of the plugin and didn't run it with -clean (either is needed for Eclipse to reload your plugin).

like image 141
Martti Käärik Avatar answered Dec 30 '25 17:12

Martti Käärik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!