Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343229 - DBCS4.1: Cannot execute Java class with package under dbcs workspace and dbcs project name
Summary: DBCS4.1: Cannot execute Java class with package under dbcs workspace and dbcs...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-19 02:09 EDT by Harendra CLA
Modified: 2011-05-10 09:02 EDT (History)
8 users (show)

See Also:


Attachments
project files (2.01 KB, application/zip)
2011-04-19 02:10 EDT, Harendra CLA
no flags Details
Screenshot (259.04 KB, image/png)
2011-04-19 02:12 EDT, Harendra CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.