Replit runs Java in your browser — nothing to install, works on a Chromebook, works at home, works anywhere you can open a tab. Any assignment we do in VS Code, you can do here. Follow the six steps, mark each one done, and you'll have a working Java setup that follows you to any computer.
Go to replit.com and choose Continue with Google → pick your school account. No new password to remember, and your work is saved to an account we can find later.
Click Create (the + button), search the templates for Java, and pick the plain Java template. Name it with your name in it — like jordan-m-java — so it's identifiable on your account. Create it.
Three panels: files on the left, your code in the middle, and the console (where output appears) on the right. Your code lives in Main.java, which starts with public class Main.
Main.java, so the class stays named Main — same file-name-matches-class-name rule you learned in VS Code, just a different name. When an assignment says "a program called ConsoleQuest," on Replit you keep class Main and put the assignment name in your comment header instead.Inside main, make it print something of yours, then press the big Run button:
public class Main
{
public static void main(String[] args)
{
// first run on Replit
String name = "YOUR NAME";
int lucky = (7 + 3) * 4;
System.out.println(name + " is live on Replit!");
System.out.println("Lucky number: " + lucky);
}
}
If the console prints your two lines, your setup is complete. If it prints red instead — that's normal, read on.
| Console says | It means |
|---|---|
insert "}" to complete... | An opened { never closed. Count your braces in pairs — the message literally names the fix. |
';' expected | A statement is missing its semicolon — check the line number it gives you. |
cannot find symbol | A name is spelled or capitalized differently than where you created it. Java is case-sensitive: lucky and Lucky are strangers. |
ArithmeticException: / by zero | It compiled fine but crashed while running — some int got divided by zero. |
| Nothing happens | Make sure your code is INSIDE main's braces, and that you pressed Run after your latest change. |
Same as always: screenshot your code AND the console output together and submit it to Google Classroom. Your repl also saves itself automatically — log in from any computer and it's waiting for you.