Runtasks command not enabled in several Eclipse perspectives


I’ve just created a new Eclipse workspace and have imported a Gradle project. When I go to the Gradle Tasks view and double click on a task I get this error in my error log:

org.eclipse.buildship.core.GradlePluginsRuntimeException: Cannot execute command ‘org.eclipse.buildship.ui.commands.runtasks’.
at org.eclipse.buildship.ui.view.task.TreeViewerDoubleClickListener.doubleClick(
at org.eclipse.jface.viewers.StructuredViewer$
at org.eclipse.ui.internal.JFaceUtil$
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(
at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(
at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(
at org.eclipse.jface.util.OpenStrategy.access$0(
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(
at org.eclipse.swt.widgets.EventTable.sendEvent(
at org.eclipse.swt.widgets.Display.sendEvent(
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Display.runDeferredEvents(
at org.eclipse.swt.widgets.Display.readAndDispatch(
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$
at org.eclipse.core.databinding.observable.Realm.runWithDefault(
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault(
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
at org.eclipse.ui.internal.ide.application.IDEApplication.start(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.eclipse.equinox.launcher.Main.invokeFramework(
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(
Caused by: org.eclipse.core.commands.NotEnabledException: Trying to execute the disabled command org.eclipse.buildship.ui.commands.runtasks
at org.eclipse.core.commands.Command.executeWithChecks(
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(
at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(
at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(
… 38 more

My colleague has observed the same but noticed that if he ran the task in the Git Eclipse perspective then it worked ok. It seems that it only fails in the Java and Java EE perspectives.

The weird thing in, is an old workspace for the same Eclipse installation it works fine.

Hi. Thanks for reporting it, we’ll look into it shortly. Could you please specify the used Eclipse and Buildship version?

The Eclipse version is:

Eclipse Java EE IDE for Web Developers.

Version: Mars Release (4.5.0)
Build id: 20150621-1200

And buildship is 1.0.1.v20150707-1402.



I also just upgraded to buildship 1.0.2 and see the same problem.

Thanks. We will look into it, but it will take a week or so before we get to that since we are currently preparing for the Mars 1 release. Thanks for your patience.

I was able to reproduce it locally with the following steps:

  1. started a new runtime Eclipse from my dev environment
  2. created a new Gradle project with a wizard
  3. switched to “Plug-in Development” and opened the “Gradle Tasks” view
  4. double-clicked on a task

However, when I changed to the “Java” perspective, the problem no longer occurred. Neither the problem shows up for my colleagues, for them it is OK on all major operating systems (linux, windows, osx).

After debugging, I stumbled upon a platform error: the ‘Run tasks’ command handler can’t retrieve the “Gradle Tasks” view’s reference. I reported my findings and opened a Buildship ticket for the issue.

I found this problem too. I’ve tried a few things and it I can consistently reproduce in different perspectives including the Java one. The way to recreate is to have the view showing in >1 perspective. e.g. add to Java EE perspective, then add to Java perspective. Works in Java EE, fails in Java perspective.

FYI we fixed the problem. If you’d like to give it a try you can install the latest snapshot from our P2 repository. Also, the fix will be part of the upcoming 1.0.6 release.

Somehow it appears that this problem is still alive!

Eclipse Neon.2 Release (4.6.2)
Buildhip 2.0.0v20170111-1029

calling build in the tasks view results in

Cannot execute command ‘org.eclipse.buildship.ui.commands.runtasks’.

This happens on a regular basis. Switched to a new laptop some weeks ago and it worked fine again. But since today I am again not able to call the build task from within the buildship task view :frowning:

I finally found the solution! It was related in my case to a combination of eclipse and linux and a needed addition to the eclipse.ini:


just before the line

Thought it’s good to document it here for others as well as for myself :wink:

1 Like