I am unable to operation the complying with code in Eclipse (Eclipse ide for Java Developers, Version: Indigo organization Release 1, develop id: 20110916-0149), and also I think that ns may have actually a configuration trouble in Eclipse (but I perform not recognize what or where):

class Saluton public revolution void main(String args<>) cable greeting = "Saluton mondo!"; System.out.println(greeting); I am additionally running against Java 6 (1.6.0_29-b11-402) on Macintosh 10.7.2.

You are watching: Selection does not contain a main type

When I run this, I acquire the error:

"java an option does not contain a key type"

but i am pretty sure that my class is written correctly...? I have actually looked this error up, and also cannot explain this difficulty so far.

TIA for any kind of thoughts or opinions!


No correct solution


other TIPS


I think you need to make your course public, otherwise it won"t work?


EDIT: mine previous answer was incorrect. The JLS states you have the right to declare arrays v the base at one of two people end. See below for part examples. Mine mistake.

Have you verified your configuration in Eclipse such the it knows wherein to find the Java compiler, and also a JVM? you can examine the project-specific libraries by right clicking the project and also going to Properties, Java develop Path

*

You can additionally check the JRE"s set up by clicking Window, Preferences, Java, Installed JREs. Make sure the JRE you wish to use is detailed here and also that the course is correct.

*


Another solution (simple and also direct):

In Eclipse: File -> Restart


Right click your class Saluton and also choose Run as --> Java Application.

It need to work.


Ok, therefore I"m a other noob, and also I come here since I had actually this problem. I confirm all my class paths and also everything, and also they to be correct. I had actually to be putting all of my files in the JRE mechanism Library Folder, rather of the source folder. I"m not certain if this to be you"r problem, but it seemed to work-related for me when I moved the code files into the src folder.

See more: Us Endowment For Forestry And Communities, About The U


I take it the long means around to deal with this; at some point I developed a package in ~ my project and included my source code to the package and it compiled and ran! ns am learning that Wizards rule!


It will occupational if you make your course as public !


Licensed under: CC-BY-SA with attribution
Not affiliated v StackOverflow
Incomplete article
*

Would you like to check out this short article or offer it a correct answer?


Login in or sign up
Stay updated
Sign up
Do you have doubts? Or do you just want more info?
Contact Us
Useful links
TagAboutContactsPrivacy
on facebook Instagram
*

The contents are license is granted under creative commons.