1

I have my eclipse plugin developed with IMP. I need to export the plugin so it can be installed on other machines. I tried to export using:

File->Export->Deployable plugin and fragments

and saved it in zipfile. I took the jar created and put it under eclipse/plugins. After restarting eclipse I still don't have the plugin enabled. I checked under the Plugin registry view and it seems inactive. the Diagnose option gave the following information:

Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-1.7

I checked my MANIFEST.MF file and it does contain the line:

Bundle-RequiredExecutionEnvironment: JavaSE-1.7

any ideas?

Hagai
  • 275
  • 3
  • 13

1 Answers1

1

You created the plug-in using Java 1.7, while the target Eclipse was using 1.6 or 1.5. You could alter the dependencies of your plug-in by

  1. changing the Bundle-RequiredExecutionEnvironment to JavaSE-1.6 or J2SE-1.5
  2. and updating the build path to the older Java source bundles: Project properties/Java build path, and edit the JRE System Library element.

Btw, it is a better idea of creating an update site instead of putting the plug-ins directly into the eclipse/plugins directory - it can cause any number of errors during installation that are hard to debug. For details, see my corresponding blog post (sry for the self-advertisement): http://cubussapiens.hu/2010/08/update-sites-in-the-p2-era/

Zoltán Ujhelyi
  • 13,788
  • 2
  • 32
  • 37
  • Thanks, but I need to use JDK7 to develop my plugin. I use some features not included in 1.6. How do I check and change the target eclipse JRE version? – Hagai Jun 07 '12 at 09:00
  • I tried to do so under Windows->Preferences->Java->Compiler->Compiler compliance level. I've changed it to 1.7 and also the JRE version to 1.7. Problem persists. – Hagai Jun 07 '12 at 09:12
  • Is your Eclipse you install your new plug-in executed using Java 1.7? Because the error message you show does not seem like that. Check in Help/About... on the Configuration tab. – Zoltán Ujhelyi Jun 07 '12 at 12:40
  • Im not sure which is the relevant line, but it all seems to point to 1.6 so you probably right: `-vm /usr/lib/jvm/java-6-openjdk- eclipse.vm=/usr/lib/jvm/java-6-openjdk- ... java.endorsed.dirs=/.../java-6-openjdk-i386/... java.ext.dirs=/.../jvm/java-6-openjdk-... java.home=/usr/lib/jvm/java-6-openjdk-i386/jre java.library.path=/usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk-... java.runtime.version=1.6.0_24-b24 java.specification.version=1.6 java.version=1.6.0_24` How can i change this? – Hagai Jun 08 '12 at 17:16
  • Either set the default Java engine to Java 7 (if not already done so), or use the command line switches of eclipse detailed here: http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse? – Zoltán Ujhelyi Jun 09 '12 at 11:07