If instead of the context menu you use a keyboard shortcut (default = Alt-Shift-X T ), you will get the following dialog:

This is a hint about why Eclipse does not show this option in the menu - it thinks there are no tests. This is clearly wrong.
Digging into the Eclipse Source Code for JUnitLaunchShortcut (lines 160-191), I found this:
private void launch(Object[] elements, String mode) { try { IJavaElement elementToLaunch= null; if (elements.length == 1) { ... } if (elementToLaunch == null) { showNoTestsFoundDialog(); return; }
It only works if you select exactly one test class.
The visibility of the menu parameter is controlled by the plugin configuration org.eclipse.jdt.junit ( plugin.xml ) and has the same problem (lines 221-234):
<contextualLaunch> <enablement> <with variable="selection"> <count value="1"/> <iterate> <adapt type="org.eclipse.jdt.core.IJavaElement"> <test property="org.eclipse.jdt.core.isInJavaProject"/> <test property="org.eclipse.jdt.core.hasTypeOnClasspath" value="junit.framework.Test"/> <test property="org.eclipse.jdt.junit.canLaunchAsJUnit" forcePluginActivation="true"/> </adapt> </iterate> </with> </enablement> </contextualLaunch>
The bit <count value="1"/> at the beginning acts as a selector, and this means the same thing: you only have to select one item or the menu item will not be displayed.
I think we found the problem :)
I also checked the file history for both of these, and they have not been changed since September 2006. So, if you managed to do this with a newer version, you most likely have some kind of plugin installed that will allow you to do this.
Tomas source share