How to express that a feature requires a certain JRE - eclipse

I use Tycho (currently v0.24) to build a p2 repository, containing a feature which in turn contains a plug-in.
The manifest of the plug-in states that it requres Java 1.8
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
If I use the Install New Software wizard of the Eclipse IDE to install this feature, it allows to install it even though the JRE that Eclipse is running on does not meet the required execution environment.
After restarting Eclipse, the just installed plug-ins are simply not picked up - quite rightfully so because of the unresolved requirement. But unaware users will wonder why the hell the installed feature doesn't show up.
Therefore I think there should be at least a warning in this case. I've opened also this bug but didn't get a respoonse so far.
In the meanwhile, is it possible to do something so that an attempt to install the feature on an unsupported JRE will fail?

Related

Eclipse bundle version tolerances

I'm trying to install an Eclipse Product into an existing Eclipse installation using a third-party-tool (namely the IBM Installation Manager) but it fails with several errors of the kind
CRIMA1054E: Installing bundle "org.eclipse.equinox.p2.repository.tools_2.0.1.R36x_v20100823" into this existing Eclipse installation does not meet the version tolerance of "[2.0.100,3.0.0)" for the existing bundle "org.eclipse.pde.ui"
Unfortunately, I can't disclose any specifics on the affected product, so I'd like to turn this into a more general question.
Following some research on the Eclipse platform, my understanding is that it is one of the key features of the OSGi Specification, that one should be able install multiple versions of the same bundle (≘ plugin?) into the same environment. If the bundle org.eclipse.pde.ui is already present, I assume that also its required version of the [...].p2.repository.tools is already available.
My question: Why should it be a problem to just add another version of that plugin to the environment? Am I getting something terribly wrong about Eclipse and OSGi?
Side question: Shouldn't version 2.0.1.R36[...] be inside [2.0.100,3.0.0) anyway? Doesn't really affect my main question though, because I have other examples that are clearly out of tolerance.
Some initial thoughts and theories
Even though Eclipse allows parallel versions of a plugin, some plugins still conflict with other versions of themselves. Still, then I would expect more of an error like "[...].repository.tools_x is incompatible with [...].repository.tools_y which is required by existing bundle org.eclipse.pde.ui"
The installation is not blocked by Eclipse but by the IBM Installation Manager. It probably does some internal dependency checking but is too lazy to consider parallel bundle version installs.
Again regarding that specific product: Unfortunately the product is not available through the regular Eclipse software installation mechanism. I also would like to avoid dropping it into my Eclipse manually because I'm dependent on regular updates and those are only delivered through the IBM Installation Manager.
Any Eclipse plug-ins that contribute UI must have the singleton directive set to true. This means that only one bundle with that symbolic name can be in the framework, see http://wiki.osgi.org/wiki/Bundle-SymbolicName for more info.
I went and inspected the org.eclipse.equinox.p2.repository.tools bundle in my version of Eclipse (3.8), and I can see that it does indeed have singleton=true.
You said: "2.0.1.R36[...] be inside [2.0.100,3.0.0)"
That's not the case, as 2.0.1 is < 2.0.100.

Plugins from Different Eclipse Configuration are not Isolated

I'm sorry for a pretty vague title, didn't want to turn it into a paragraph.
So, I am using Eclipse Platform 3.7.1 (the one with absolutely no plugin preinstalled), the latest version so far, and I have discovered that by taking advantage of its -configuration option, I can choose which plugins are running and which are not. It was going well enough until I started installing the plugins.
But allow me to explain my setup first, I am using Ubuntu linux by the way. Using only one eclipse installation, my installation is arranged in the following order:
Installation:
~/bin/opt/eclipse
eclipse (executable binary)
~/bin/eclipse -> opt/eclipse/eclipse
Configurations:
~/.eclipse/configuration
web-php
android
java
Installing JDT and ADT while running eclipse and using the android configuration directory posed no problems. So I moved on to the php configuration and tried to install PDT (the JDT and ADT plugins were not activated here, so far so good). The problems came along after the installation, not only was I not able to use PDT, I noticed in the Installation Details that JDT, ADT, PDT were installed but not activated. Instead, they were all activated in the android configuration. To make it worse, when I chose the Java configuration, I could not even use JDT.
My expectations however were when using:
eclipse -configuration ~/.eclipse/configuration/android
was that only the JDT and ADT were activated and when using:
eclipse -configuration ~/.eclipse/configuration/web-php
only the PDT is activated
Regarding the java configuration however, it's probably another problem altogether but if there was help on how to activate a plugin installed from another configuration, I'd deeply appreciate it.
Also, see Single Eclipse install with multiple Configurations and Workspaces
In a p2 world there are extra steps to isolate bundles from each other. You need not just a different configuration directory, but a different p2 profile.
Have a look at the config.ihi in each of your configurations. There are two ways that Eclipse identifies the plugins to use, the ..updateconfigurator, which simply uses all of the plugins in the plugins folder, and the ..simpleconfigurator which uses the bundles.info file in that's in the org.eclipse.equinox.simpleconfigurator folder (which is maintained by the p2 installer). Make sure this file is what you expect.
And also, you might want to start with the -clean option if you are using the updateconfigurator to have it rescan all of the plugins (otherwise it remembers in some hidden cache).
Make sure when you installed everything that you had your -configuration set to the right place for the different things you installed.
I hope some of this points you in the right direction.

Issue with updating eclipse

When I select "Help->Check for Updates" in eclipse, I get the following error message at the bottom of the window. From this message "Only one of the following can be installed at once: " it appears I have multiple copies of the same component installed. Under "About Eclipse SDK=>Installation Details" I found at least two instances of Equinox P2 Provisioning: under "Eclipse SDK" and "PHP Development Tools".
Any suggestions on how to get this resolved would be much appreciated.
I'm running eclipse helios 3.6.1 on CentOS 5.2.
Cannot complete the install because of a conflicting dependency.
Software being installed: Eclipse SDK 3.6.2.M20110210-1200 (org.eclipse.sdk.ide 3.6.2.M20110210-1200)
Software currently installed: Shared profile 1.0.0.1288623084982 (SharedProfile_SDKProfile 1.0.0.1288623084982)
Only one of the following can be installed at once:
Equinox p2 Provisioning 2.0.1.r361_v20100903-897HFZFFZRuSD2LMtVxyz0Vr (org.eclipse.equinox.p2.user.ui.feature.jar 2.0.1.r361_v20100903-897HFZFFZRuSD2LMtVxyz0Vr)
Equinox p2 Provisioning 2.0.0.v20100503-897HFZ-FdHjO2NQo0sD_Nt (org.eclipse.equinox.p2.user.ui.feature.jar 2.0.0.v20100503-897HFZ-FdHjO2NQo0sD_Nt)
Equinox p2 Provisioning 2.0.1.r361_v20100903-897HFa-FX0z-z-ntoaavz0JPX628 (org.eclipse.equinox.p2.user.ui.feature.jar 2.0.1.r361_v20100903-897HFa-FX0z-z-ntoaavz0JPX628)
Cannot satisfy dependency:
From: Shared profile 1.0.0.1288623084982 (SharedProfile_SDKProfile 1.0.0.1288623084982)
To: org.eclipse.equinox.p2.user.ui.feature.jar [2.0.1.r361_v20100903-897HFZFFZRuSD2LMtVxyz0Vr]
Cannot satisfy dependency:
From: Equinox p2 Provisioning 2.0.1.r361_v20100903-897HFa-FX0z-z-ntoaavz0JPX628 (org.eclipse.equinox.p2.user.ui.feature.group 2.0.1.r361_v20100903-897HFa-FX0z-z-ntoaavz0JPX628)
To: org.eclipse.equinox.p2.user.ui.feature.jar [2.0.1.r361_v20100903-897HFa-FX0z-z-ntoaavz0JPX628]
Cannot satisfy dependency:
From: Eclipse SDK 3.6.2.M20110210-1200 (org.eclipse.sdk.ide 3.6.2.M20110210-1200)
To: org.eclipse.equinox.p2.user.ui.feature.group [2.0.1.r361_v20100903-897HFa-FX0z-z-ntoaavz0JPX628]
Update 9/15: I read somewhere that this may be due to a permissions issue and that I should run eclipse as root and perform the update. I was indeed able to complete the 3.6.2 SDK update as root but then afterwards all of my add-on components (e.g. subclipse, PDT, etc.) were gone.
You are getting this message because you are trying to install into a read-only (shared) location. The indication is at this line:
Software currently installed: Shared profile 1.0.0.1288623084982 (SharedProfile_SDKProfile 1.0.0.1288623084982)
The reason why there is a failure is that your install plan would remove an old version of a feature that is part of the shared install. Since a shared install cannot be changed, you get the conflicting dependency.
As it happens, I am working on a patch for exactly this bug. See:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332158
The fix would not allow you to install in this situation, but it would at least provide a better error message for you.
I got this message or something similar because I had installed Eclipse to my C: drive on Windows 7. Trying to do an update required escalation but Eclipse wasn't prompting me. When I restarted Eclipse using "Run as Administrator", it had the proper permissions to continue and it let me upgrade.
Cannot satisfy dependency:
From: Eclipse SDK 3.6.2.M20110210-1200
It needs a dependency that only exists in the update site for Helios 3.6.2 and you are running 3.6.1. You can either upgrade to the latest version of Helios (or better yet, Indigo) or add the update sites. I don't know the URL's off the top of my head, but you can try this method:
Download a fresh copy of Helios and install it to a separate folder. Open up help>install new software and click "available software sites". Then export the default sites and import them into your existing Eclipse installation. Your plugins should now update correctly.
EDIT: add this to your update sites: http://download.eclipse.org/eclipse/updates/3.6/
Note that shared install have now (upcoming Eclipse 4.3, 2013) a way to:
Detect shared install changes:
When Eclipse is running in a read-only folder (also known as shared install) and the read-only installation has changed (e.g. new plugins installed, new version of Eclipse installed), Eclipse will now detect this change and warn that your personal additional plugins have been uninstalled.
Provide a Migration Wizard:
Eclipse now includes a migration wizard to help users through the re-ininstallation of their plug-ins.
This wizard is presented in two situations.
First, when a read-only installation of Eclipse is being changed (i.e. Eclipse is being updated or plugins are added / remove),
second when a new read-only installation of Eclipse is run for the first time.
See also "Shared installs just got better!" for more:
Building on this support, we've also decided to assist users in re-importing their plug-ins from a previous read-only installation.
The reason is simple, many corporations chose to deploy new versions of Eclipse in different folders. This is required to give teams the ability to adopt Eclipse at their own pace, but it also means that when users start using a new Eclipse install, they need to re-install the plug-ins they had installed on their own.
Of course users could use the import/export feature provided by p2, but the time wasted by the user wondering why the plug-ins have vanished and then figuring out what to re-install can be significant, which is why in such situation we are also presenting the migration wizard.

Is there a way in Eclipse to find out plugins that are not used?

I am struggling with this!
While trying to install some features - eclipse keeps complaining about some dependency not met and about old version of some dependencies. The messages are rather not straigtforward.
Is there a way to clean the eclipse installation of the unused plugins? Does eclipse tell you on its own as to which features/plugins have not been used (for a while)?
What would be the definition of an unused plugin? All plugins that Eclipse update manager is referencing are currently in use because they were installed directly or are referenced by plugins that were installed directly.
I am not aware of anything that would actively track which features you are utilizing while using Eclipse and then report on unneeded plugins.
The error that you are running into typically happens because plugin A that you have depends on plugin X v1 and you are trying to install plugin B that requires X v2. Since both v1 and v2 of X cannot be simultaneously installed, installation of B aborts.
Here are the two most common causes of users finding themselves in this situation:
You haven't run "search for updates" recently, so many of your plugins are on older service levels. The plugin you are installing, however, requires a newer service level of a particular plugin. Resolve by updating your installation prior to trying to install the new plugin.
The plugin you are trying to install was not designed to be compatible with the major version of Eclipse that you are running. For instance, you might be running Eclipse "Galileo" 3.5 platform while the plugin you are trying to install was designed to work with Eclipse "Helios" 3.6 platform. You cannot use the update manager to move between major releases. Pay attention to what yearly release the plugin advertises support for. If it needs a newer version and you are willing to upgrade, you will need to download a new package.
Outside of that, post a new question with specific failure message you are getting along with details about your current installation and what you are trying to install. Someone here ought to be able to translate the installation failure into resolution options for you.

Installing Eclipse

I am installing Eclipse for RCP and RAP Developers. My old copy went rogue and decided to act up.
So clean install time! Yay! I downloaded the new version, copied it to the opt folder, extracted it, and ran it.
For some reason, I can't install any plugins due to some crap error*, and it doesn't have a list of default plugins. I deleted my workspace and the original Eclipse install.
Is there another file that is helping Eclipse keep data from previous installs? I am seeing update sites I added when I was constantly trying to get past this issue.
Also, why can't I install new plugins?
I need a clean install so I can't use the Ubuntu installer.
Any tips are appreciated.
*Cannot complete the install because one or more required items could not be found.
Software being installed: Maven Integration for Eclipse (Required) 0.10.2.20100623-1649 (org.maven.ide.eclipse.feature.feature.group 0.10.2.20100623-1649)
Missing requirement: Maven Integration for Eclipse (Editors) 0.10.2.20100623-1649 (org.maven.ide.eclipse.editor 0.10.2.20100623-1649) requires 'bundle org.eclipse.zest.core 0.0.0' but it could not be found
Cannot satisfy dependency:
From: Maven Integration for Eclipse (Required) 0.10.2.20100623-1649 (org.maven.ide.eclipse.feature.feature.group 0.10.2.20100623-1649)
To: org.maven.ide.eclipse.editor [0.10.2.20100623-1649]
I had the same problem when doing a fresh install of Java EE eclipse (helios, galileo, win32 and win64).
The solution for me was to explicitly open the Java perspective, and doing the install after this. This time the installation worked fine.
I suspect the reason is that after a fresh install not all bundles are loaded (although they are present on disk; a feature of eclipse) so that the dependencies cannot be resolved. Opening the Java perspective or creating a dummy Java project will force to load these bundles. Once a bundle is loaded, its existence is persisted, so this only has to happen once.
This issue was mentioned a number of time on the official websites, but always closed or neglected, probably because the reproducer did not do a fresh install.
Download Eclipse 2018-19 (4.9.0) version as an updated eclipse version and install it! Maven dependency will presented inbuild thing in that model, Right click on project -> properties -> on left pane, Maven will display ! Change your setting there to overcome this error and you can add external JAR'S there