Help! I’m facing an error while trying to run my HelloWorld program

0
0
Asked By CuriousCoder92 On

Hey folks! I'm new to programming and I'm trying to write a simple HelloWorld program. However, I'm hitting an error message that I can't figure out. Any ideas on what might be going wrong? Check out my code here: [imgur link](https://imgur.com/a/BKKoLC1)

3 Answers

Answered By OldSchoolCoder On

You may also want to compile your code manually using the terminal: run `javac HelloWorld.java`, then `java HelloWorld`. Make sure that you have the main method set up correctly. If it’s not printing ‘Hello World’ to the console, we might have a mix-up with your main file's configuration.

Answered By DebugMaster On

Before diving back into code, check that your Java SDK is set correctly in IntelliJ. Go to File > Project Structure > SDK and ensure it’s linked properly. If that doesn’t fix it, try invalidating cache from the File menu.

Answered By CSharpNerd On

From my experience with C#, don't forget to import necessary libraries. In C#, you'd use `using System;` and have your main function set up in the right class. I'm not sure for Java, but is there a similar requirement? Just a thought!

NewbieDev34 -

I double-checked, and it seems Java doesn't need to import System. Thanks for looking out, though!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.