Eclipse: Activator class is invalid


well, during my resurgent interest in my Esftp plugin, I found I couldn’t compile it, I solved the original problem in my last post on eclipse, you can find it here

Eclipse and Plug-in Dependency Fun

Well, after getting past that, I was onto victory, or so I thought, I could build the plugin fine now that I knew the problem with the Filesystem and FAT32 filesystems, however when I tried to run the plugin in a debug environment, I couldnt get anything to run, I could see the basic elements, but I could not see the workspace or project preferences panels, when I tried to open them I got a dialog saying it could not create them.

I was advised on #eclipse channel to use the -consoleLog option which will output any errors that I have when I am running my plugin, upon using this option, I got a whole bunch of errors, some of them nothing to do, but this one in particular was a problem.

!ENTRY org.eclipse.osgi 2 0 2007-07-16 22:54:27.236
!MESSAGE The activator com.antimatter_studios.esftp.Activator for bundle
com.antimatter_studios.esftp is invalid
org.osgi.framework.BundleException: The activator
com.antimatter_studios.esftp.Activator for bundle
com.antimatter_studios.esftp is invalid

Caused by: java.lang.ClassNotFoundException:
Root exception:
java.lang.ClassNotFoundException: com.antimatter_studios.esftp.Activator

So, basically, Eclipse was telling me that the Activator class for my plugin, was invalid, but I couldn’t see anything wrong with it, it was ok to me and it followed the rules of the Hello World test plugin I created, but still, it wouldnt load properly.

Here is the solution that I found and used, now my plugin exports properly, debugs properly, etc, etc. Good work team !

ok, after talking to paul webster on IRC, I found the solution, which was that on the build tab, at the top, you have two sections under “runtime configuration”, on the left, you have add library, it usually contains “.” as the only item, or more, but “.” is usually there. On the other side, you have add Folder, there was the problem, it was empty, upon adding “src”, which is the folder containing the plugin source code, I was able to finally get the plugin to work.

so I hope that helps some people and saves them from the problem I had.

See you next time!

25 thoughts on “Eclipse: Activator class is invalid”

  1. obviously this isnt the sole reason for this problem, but a possible solution, it worked for me and the other commenter, sorry it didnt work for you.

    are you working with a fat32 filesystem? if so, there is another article on eclipse and fat32, maybe that would help.

    if you do solve it, please give me a thought and come back to explain it ok!

  2. was a long time ago, but I believe that it was in the project properties, try in there, I can’t remember the specifics now, maybe I can look again and find out.

  3. After getting some help from rcjsuen on freenode #eclipse, I found a solution when the above doesn’t completely solve things.

    Basically, you need to make sure you have the following in your bundle MANIFEST.MF:

    Bundle-ClassPath: ., (other libs)

    The . (bundle root) is the key entry here. If you don’t include it, your classes won’t be exported when you test.

  4. If you are building a plugin under Eclipse Galileo, 3.5.x, your (basic) should look something like this:

    source.. = src/
    output.. = bin/
    bin.includes = plugin.xml,\

    That fixed things for me at runtime when I was getting messages such as follows, when upgrading an old plugin source:

    org.osgi.framework.BundleException The activator … for bundle … is invalid … java.lang.ClassNotFoundException

  5. Hey folks: Here is My solution to the problem (I am developing Bundles for Eclipse Equinox(the OSGi implementation)) :

    AND THE SOLUTION is V-E-R-Y simple -> just add -dev bin to your Program Arguments under (Run->Run Configurations->”Your_Loader”->Tab “Arguments”)


  6. this problem might be caused by that you changed the package of the activator, since it will record with default setting.
    its really simple, in my eclipse 3.4.2, the solution is:
    click the “”
    in the “overview” window, on “general information” tab, you will see “activator “, then you can change the activator to the activator in your package.

  7. @quanjian_wang: good job! you are the first to actually explain something that seems a solution, apart from a workaround.

    thanks mate! I’m sure lots of people will appreciate your help.

  8. Hi!
    I have the same problem and i am try to solve it, but i don’t understand what means ” -dev bin”. Can You explain me?
    Thanks a lot!

  9. @EK they are arguments you pass on the command line, drill down through the options that mrj81 mentioned and you’ll find where to put it.

  10. This is my argyment string
    -os ${target.os} -ws ${} -arch ${target.arch} -nl ${} -consoleLog -console -dev bin
    its the same error :(

  11. well, I am not sure about the solution because I’ve never tried it, but there are other solutions mentioned here, perhaps you can try one of those and see if that works better?

  12. I love this site Lot of great information. I am Tech guy. I have been a Desktop Technician since 1997 but have tons of other interests. In my spare time… Oh, wait I don’t have any of that (just kidding). Anyways, I have been aware of this website for quite some time and decided to join the community and contribute as well as learn a lot from others. I am excited to get started on the forum and am looking forward to a great journey together. Lots of potential friends and I look forward to meeting many online.

  13. thank you so muck chris.alex.thomas! it worked for me! i added the .jar i wanted and then i added src folder! in my case i searched the web for two days full but nothing else worked! so thank you very much again! sharing solutions with people all over the world is the beauty of the internet!

  14. Brett’s answer solved my problem!
    After hours of trying suggested solutions it FINALLY worked! Thank you very much. Inclusion of a simple “.,\” in my solved my ClassDefNotFound-Error that caused my “invalid Activator”.

    If everything complicated fails, alway try the simplest of things. =)

Leave a Reply

Your email address will not be published. Required fields are marked *