Right now, I'm trying to teach my friends how to code. I've gotten past some pretty basic stuff and am trying to have them run their code.
I just downloaded the latest Eclipse version: Eclipse Photon, and have the latest JDK. For some reason, the following code throws the error: "Editor does not contain a main type."
It worked fine when I was using Oxygen, so I don't know what would be different.
public class Tutorial {
public static void callMe() {
}
public static void main(String[] args) {
callMe();
}
}
At this point, I'm trying to teach my friends methods and calling them. I'm about to get to Integers, but for some reason, Eclipse doesn't want to run. I don't know if it's JavaSE-9 - I used JavaSE-1.8 with Oxygen - or something else, but I'm really confused because, as you can see, I have a main method.
EDIT: It's a problem with JavaSE-9. Just tried 1.8 and it works fine. Is there any way to fix this problem?
Your code is working fine with Java 8. But try these steps once.
1.) Right-click over your class-> Run As ->Run Configurations
2.) Create New Launch Configuration in Java Application.
3.) Give your project and main class in respective options and try to run. Hope it solves but better to use Java 8 as it is stable altogether.