I cannot compile new code

When I compile new code it is as if it reads the previous code. When I open a new replit with Java it will print out the default “Hello World!”. I changed browsers and issue continues. :frowning:

Hey @enroch welcome to the forums!

Thank you for your post and sorry that you are experiencing issues. However, the Replit support team may not be able to help you with this issue if you do not complete the template fields fully.

Without knowing the expected and actual behavior (screenshots are fine for this section) as well as the link to your Repl and the steps a member of the support team will need to follow to reproduce the error there won’t be much we can do to help you.

The more information you provide at the start, the easier it will be to identify if your bug report is an issue or a misunderstanding.

1 Like

I just created a new repl and when I run it, its almost as if it saves the first code and compiles it over and over. I have posted screenshot.

You cannot run commands in Console as it is the output of your program. Try Shell instead.

1 Like

You can actually run commands in the console on certain repls (Blank repls are a good example), It seems they just used the wrong command to compile the program. (On that note, please use the run button though!)

2 Likes

I tried shell and I get the same thing.

That screenshot still shows you using Console.

2 Likes

Sorry I am new to Java. Not sure what that means.

seems like it is defaulting back to console on its own. I close it out and it goes back to it once I click on run.

Every single time the program is run it takes you back to console no matter what you’re doing. It doesn’t matter if you are in the code or in the chat or in the shell. It is super annoying.

1 Like

Use the run button instead of trying to run your code manually please. I believe it should auto re-compile if you use that.

2 Likes

I tried that and it gives me “Hello world!” not matter what code I try to run.

Perhaps you should share the link to your Repl then.

1 Like

https://replit.com/@enroch/Mycode

2 Likes

It works fine for me…

I don’t know Java but what’s the problem? It prints “Hello world!” Replit doesn’t run the open file; it runs the main file for whatever language you’re using.

1 Like

Try changing the Class declaration in the main file to “Main” instead of “HelloWorld”

1 Like

That’s the problem, it’s not running the correct file (In this case, I believe it’s an error caused by using the wrong class name)

2 Likes

haha Thanks everyone!

If your problem is solved, please mark the post that solved it as the solution (Firepup650’s I believe).

1 Like