r/javahelp • • Nov 25 '20

New to Java

I’m new to Java and am taking a class online. I’m having trouble understanding anything. I can’t get any program to run, even when the instructor gives me the program to copy. Can anyone explain it in terms that an idiot can understand? I can create a class...then I’m at a loss. My instructor just seems annoyed that I don’t get it. I’m afraid he’s just going to fail me without helping.

0 Upvotes

10 comments sorted by

View all comments

Show parent comments

0

u/CAS05140814 Nov 25 '20

I have to run in Eclipse. I guess my main question is not so specific, but I just don’t understand what to say in any given instance. Like in a normal sentence I need a noun and verb. What do I need for a Java program in general? Is there an outline I can follow? Everything I’ve tried to run says there is no main, but I enter the line that says main so I thought that’s what I needed.

0

u/Camel-Kid 18 year old gamer Nov 25 '20

Java is case sensitive so you need to make sure that your main is declared properly.. ie public static void main(String args[]).. if you confirmed that, then you can right click on the class and hit run as->java application

0

u/CAS05140814 Nov 25 '20

Ok. And if that is correct, why would it say no main?

2

u/Camel-Kid 18 year old gamer Nov 25 '20

it should only say no main if there is no main, or the main is not defined correctly... orr you are not running the right class file.