I downloaded eclipse-jee-kepler-SR1-linux-gtk-x86_64.tar.gz
. This eclipse is built-in with java and my Lubuntu is 64-bit. Whenever I compile and run a simple code in java like this one below:
public class Sample{ public static void main(String[] args){ System.out.println("YOLO"); } }
I always get an Editor does not contain a main type
. I put the file in a project folder called Sample
. This eclipse should compile java code because its an IDE distribution specialized for java.
How can i resolve this error?
Any help would be much appreciated.
Here's my project structure:
MainType is a powerful but easy to use font manager and font viewer for Windows, that takes the frustration out of managing your fonts. It is packed with tons of intuitive features that makes it simple to find, preview, organize, install, and print your fonts.
You can set which Eclipse editor or external program to use to open a specific type of file based on its file extension. Just select Window→ Preferences→ Workbench→ File Associations, select the file type, and associate an editor or program with it (if nothing else, you can use Eclipse's default text editor).
Problem is that your folder is not identified as a Source folder.
I just had this exact same problem. This will sound crazy but if someone sees this try this before drastic measures. delete method signature:
public static void main(String args[])
(Not the body of your main just method declaration)
Save your project then re-write the method's header back onto its respective body. Save again and re-run. That worked for me but if it doesn't work try again but clean project right before re-running.
I don't know how this fixed it but it did. Worth a shot before recreating your whole project right?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With