Always prints hello world

I am new to coding as part of a class, but I know enough to know this shouldn’t happen.
Every time I run my code, it always prints “Hello world!” rather than what I have asked it to print. How do I fix this, I have tried creating new projects with the same code and it has done the same thing every time. Help, please.

1 Like

Hey @ThomasGruszkos welcome to the forums!

Thats because the repl is running the file file. You can either add the code in that file or edit the entry point in the .replit file so it runes a different file/


This is because you’re working in a file called I believe it only runs You can move your code in there OR change the entrypoint in the .replit file to be your file.


Lol, you posted just a few seconds before I did.


Unfotently I am going to ban you for plagiarism of my answer and I will need to report your main account to site mods :laughing:


Hi there @ThomasGruszkos, by default Replit is looking for the Main class. If you want your health class to be the like the base object, you’ll need to change the run field in the .replit file (click “show hidden files” after clicking the 3 dots at the top of the filetree) to: java -classpath .:target/dependency/* health (note the changed class name at the end).

As a bonus, if you wish for your file to be shown when you load into the repl, you can change the entrypoint field to :slightly_smiling_face:


Will we have to repeat again and again for new program.

Hey @Dev213! Welcome to the community!

Yes; every time you create a new Repl, it will always default to

You can import files to, manually compile it using the shell:


or use the methods that the others have mentioned to run Java files other than