The Editor does not contain the Main type is a common error that you might come across while using eclipse. It usually means that the editor did not find the correct main type for your class or interface. You can fix this problem by correcting the typo in your java file and saving it once again. In some cases, you may also need to restart the eclipse so the new changes are recognized properly. The Eclipse Editor does not contain the Main type is one of those errors which can be fixed easily but if ignored for too long, it will create more problems later on down the line.
If the error is not fixed, future compilation will fail and the editor might display an exception dialog. The problem can also get worse with time because more errors could show up when you try to compile your code in eclipse. In order to avoid these issues, always make sure that you fix this type of issue as soon as possible. the Editor does not contain the Main type (a common error that can be fixed easily but ignored for too long) one of those errors which if ignored for too long creates more problems later on down the line, if left unhandled it may manifest into other troublesome ones over time. Eclipse Editor does not have a Main Type (the same applies here) we are not the only one with this problem.
How to fix it?
You need to locate the editor in eclipse and change the main type from Java Editor (default) to My Main Type, for example as shown in the screenshot below:
Locate the error message “Eclipse does not contain a program named ‘program_name'” or “The current configuration does not match any of these editors”. This can be done by locating your project name on Eclipse’s left sidebar, Select the textbox that says “Main Program” near where your cursor is placed when editing code, and switch out what you have there with some information about your desired new main type – In this case, I am changing it from Java Editor to C++ Editor.
How to remove it?
Simply rename the .project file in your project directory from “default” to something like “My Project”. Just make sure you know where this is and that there are no files being generated before, during, or after renaming. After having renamed the default file, Eclipse will create a new one for us with our desired main typeset as the main editor program. This tutorial can be applied if you do not have any other problems with eclipse’s configuration – just keep Java Edit selected by default!
If we change the name of our project (e same applies here) we are not the only one with this problem.”Eclipse does not contain a program named ‘program_name'” or “The the editor does not contain the main type”
This is a problem that plagues many developers. Some people have reported overcoming the issue by making sure to use the same program name in both places, but this will not work for all projects.”Eclipse can’t find your java project’s configuration settings”. I found out it was due to me having two different versions of Java installed on my computer. The fix took about five minutes and involved opening up Eclipse (I just right-clicked on “eclipse”) and selecting preferences from the dropdown menu at the top left side of my screen. From there I had to select Java and ensure only one version of Java was selected under Installed JREs – most likely because you know which one you want to use most.
Anti-Google: the editor does not contain the main type, how can be removed?
“The solution is simple”. This error should go away if you delete any *.map file in your project directory. The Eclipse text editor doesn’t show the Java code because it’s looking for a .java extension when viewing that folder.”Eclipse hides java source files from view”. If you don’t have these sources there then they won’t show up at all and will stay hidden until you add them back again. How do I fix “the editor does not contain the main type”? This problem has been found in Google Chrome users who try to access their projects using the website interface instead of through an installed IDE like an eclipse.