Java beginner waiting for solutions

Hello! I am a beginner, and i just started to learn Java, and basically I have no basic knowledge for programming. I met with a problem (shown in the pics). In Mosh’s project, a file(.class) is under the file named codewithmosh. However, in my project, there is no such file. Why did that happen? How can I do that like mosh’s project?
Thank you!

I am having this same issue - I don’t quite understand how the package concept works.

If you haven’t built your project yet, that may be the reason. Try selecting Build from the menu bar at the top, then click ‘Build Project’.
Once build is complete, you should have a Main.class file.

Another possibility is that you have the file extension hidden (due to your settings in IntelliJ). If you can see a file called Main inside that folder, without the .class extension, this will be the same file.

Guys help me, I need to know if we should download the same java version Mosh used in his project to prevent problem in future or we should look for new version???

You can find the first part of my answer on the “JDK and IntelliJ version issue” topic, as they limit new users to share only one screenshot per post and maximum three posts per topic.

7.) right click on the package you just created → select New → select Java Class → and name it Main

Tadaaa!!! Now it looks exactly like Mosh’s and you can follow him along.

Thank you very much for this, was trying to find it for a week now.
Good work, thx for the help!!!

1 Like