Community
Participate
Working Groups
Build Identifier: I20110412-2200 OS: Mac OS X Java environment:1.6.0_24-b07-334 Locale:ja_JP.UTF-8 This occurs when all of the following three parameters are met 1. Using DBCS workspace. 2. Use DBCS project name for java. 3. Java class is under a package (not default). Reproducible: Always Steps to Reproduce: 1. Start a Eclipse 4.1 under workspace called スニペット 2.Create a new java project called スニペット 3.Create a new class with following contents package org.eclipse.swt.snippets; public class TestSnippet { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("out"); } } 4. Try to execute the class, you get error saying "Selection does not contain a main type" Please look at the attached project file and screenshot for the reference.
Created attachment 193542 [details] project files
Created attachment 193543 [details] Screenshot
Moving to JDT/Debug
The reported exception come from context launching. Harendra, what do you have selected when you try to run the snippet? Specifically, that message is presented when you try to context launch something and there is no selection made in the workspace. Using: Version: 3.7.0 Build id: I20110412-1532 Ubuntu 64bit Locale: ja_JP Steps: 1. new workspace using the DBCS names given in comment #0 2. import example project into workspace 3. open TestSnippet 4. press the Run or Debug button Expected: the snippet runs and the output "out" is written to the console Happens: what was expected.
I will re-try my steps using 4.x on Mac
(In reply to comment #5) > I will re-try my steps using 4.x on Mac Yes please check under Eclipse 4.1 and if it works please let me know the build ID.
(In reply to comment #6) > (In reply to comment #5) > > I will re-try my steps using 4.x on Mac > > Yes please check under Eclipse 4.1 and if it works please let me > know the build ID. Using 4.1M6 on the Mac the same steps also work for me. As I mentioned, I think you just do not have the Java file (or any of its containing resources) or the editor selected when you are trying to launch. Steps to reproduce the exception dialog: 1. open the attached project and source 2. select the problems view 3. press the debug button 4. you see the dialog mentioned in the screenshot Harendra, can you confirm that you have properly selected the element you are wanting to launch?
Seems to have been fixed in new Head.