r/javahelp • • Apr 02 '16

help?

I am new trying to learn java programming i started watching "thenew****" Tutorials, everything was fine untill i reached the second video where i reach the command prompt part to load my code. When i want to put ex " java Hello.java" It says Error: Could not find or load main class. DOnt even know if i have the right java or version anyway this is it . jre1.8.0_45 . Hope i get helped.

0 Upvotes

13 comments sorted by

View all comments

1

u/empire539 "empire"+(((int)-~(byte)+('\''&~'&')<<(' '>>('+'+~'(')))+0x1b); Apr 02 '16

Try java Hello instead, after you've compiled using javac Hello.java.

1

u/superAA_ Apr 02 '16

same error

1

u/empire539 "empire"+(((int)-~(byte)+('\''&~'&')<<(' '>>('+'+~'(')))+0x1b); Apr 02 '16

Did you name your class Hello?

1

u/superAA_ Apr 03 '16

I first called it apples then HelloHP but didnt work.

1

u/empire539 "empire"+(((int)-~(byte)+('\''&~'&')<<(' '>>('+'+~'(')))+0x1b); Apr 03 '16

Your class name needs to be exactly the same as your file name. Calling your class "apples" or "HelloHP" will not work if your file name is named Hello.java. Your class needs to be named "Hello" exactly (including capitalization, so naming it "hello" won't work either).