r/learnjava • • Jan 14 '20

Main Class

I am just starting to learn Java. I am using IntelliJ on mac. I cannot even run hello world. It says could not find or load main class. I can't find what the main class is or how to add it. I have been trying to fix the run configuration for an hour. Please help me before I quit CS after 2 weeks

1 Upvotes

9 comments sorted by

View all comments

7

u/sd_owens Jan 14 '20

All Java programs run from main(). It is the first function (method) that is run and all others follow from there. When you start IntelliJ you should select new project and it will build a Hello World program for you with a main method. If you don’t know what main() is I highly recommend a book or YouTube videos.

To be real, if you can’t find the answers above with a quick google and give up after two weeks maybe CS is not right for you.