Question:
everytime i run my code the output is always Hello world
Repl link:
code snippet
Question:
everytime i run my code the output is always Hello world
Repl link:
code snippet
Hi @John-AldrinAld1 , welcome to the forums!
Have you created another file (other than main.java
) and want that file to run?
Hey @John-AldrinAld1!
Just click the ⋮ next to “Files” then click “Show hidden files”. Next click on the .replit
file and finally you can change the entrypoint
to whatever file you want to run.
You can also change the second line from run="run_command_for_lang main.java"
to run="run_command_for_lang fileIWantToRun.java"
, though it won’t have an effect for languages with interpreters as shown in the comment on line 1.
Also see the docs on how to configure a Repl: https://docs.replit.com/programming-ide/configuring-repl
Hope this helps!
Hi @John-AldrinAld1 !
Are you facing any problems with the steps I mentioned? Do you need any help?
Hi Nate,
I’m having issues with this aswell.
I followed your instructions but it doesn’t seem to do anything.
I get the same Hello World.
I posted the link. It says it’s waiting approval. I don’t know if there is a way to send it directly.
Hi @BennyMoran && @John-AldrinAld1,
You guys are using Java, so changing the entrypoint
won’t change the file to run. Instead, you will need to change line 2, where the run
command is set. Change “Main” to the name of the file you want to run.
@BennyMoran in your case it would be:
run = "java -classpath .:target/dependency/* TextGame"
Thank you so very much! That worked perfectly!!
BennyMoran isn’t OP. He can’t mark the post as the solution.