Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343229

Summary: DBCS4.1: Cannot execute Java class with package under dbcs workspace and dbcs project name
Product: [Eclipse Project] JDT Reporter: Harendra <harendra>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, kennoji, kitlo, Michael_Rennie, namle, Olivier_Thomann, pwebster, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
project files
none
Screenshot none

Description Harendra CLA 2011-04-19 02:09:03 EDT
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.
Comment 1 Harendra CLA 2011-04-19 02:10:59 EDT
Created attachment 193542 [details]
project files
Comment 2 Harendra CLA 2011-04-19 02:12:25 EDT
Created attachment 193543 [details]
Screenshot
Comment 3 Olivier Thomann CLA 2011-04-19 12:49:41 EDT
Moving to JDT/Debug
Comment 4 Michael Rennie CLA 2011-04-19 13:55:47 EDT
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.
Comment 5 Michael Rennie CLA 2011-04-19 13:56:11 EDT
I will re-try my steps using 4.x on Mac
Comment 6 Harendra CLA 2011-04-19 22:44:57 EDT
(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.
Comment 7 Michael Rennie CLA 2011-04-29 12:36:32 EDT
(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?
Comment 8 Harendra CLA 2011-05-10 01:22:56 EDT
Seems to have been fixed in new Head.