Ask coding questions

← Back to all posts
Why is Repl so slow for Java?
GeorgeZhou1 (1)

I run code in Java in Leetcode editor and it takes less than 1 second to execute. But in Repl it takes like 5 seconds. Why is this? I'm trying to learn Java so I have to execute code A LOT because half the time the code has some sort of error or I just want to run a random piece of code to see if it actually works. Does anyone know of a faster platform? I'm using Leetcode right now but Leetcode honestly doesn't seem like a formal IDE to learn Java...

Coder100 (18873) is super slow for java, it always has been. I think it's because of the compiler they use, or how they are using it.

Anyways, create a .replit file, and inside put:

run="javac [File].java ; java [Class]"

Then, after you have compiled:

run="java [Class]"

Also report this to feedback!

Bookie0 (6360)

Hi there!

A few hours ago had a sorta outage; the site was down, things were taking super slowly to load, etc.
it should be fixed now, but maybe still not working for you or something like that.

But anyways, what you've described seems like a bug, because Java should normally execute not in 5 seconds (unless your code is super super super long).
try one of the following:

  • reloading page/deleting tab
  • forking repl
  • making new Java repl to see if the problem persists
  • make a repl in a different lang to see if other languages have this problem. If yes, its most likely a bug, you can report it here

If you want faster platforms, try these:


GeorgeZhou1 (1)

@Bookie0 I'm running the code right now with a fresh java repl that just prints "Hello World". It takes about 5 seconds every time I click the run button until I can see "hello world" actually printed out. In python Repl, it takes less than 1 second to see "hello world" printed out. I personally would prefer an online IDE as I don't like to deal with packages/installations of stuff locally.

Bookie0 (6360)


I tried making a repl in java, and yea you're right it takes more or less 3-5 seconds to execute!

i tried searching online if java is slow, found this.)

and maybe this could be useful (probably not tho)

and i tried searching "java execution slow", but still didnt find anything unfortunately.
I guess you can suggest that make execution faster in feedback

So i guess you gonna have to live with it being slow, even if thats annoying. Or you can switch to another online IDE, i heard Vscode is great.

but yea sorry about that :/ @GeorgeZhou1

DynamicSquid (5022) may be little slow for Java. You can try downloading a Java IDE like IntelliJ, or perhaps try getting's hacker plan for faster computing power. I would recommend downloading IntelliJ since it's free and used by professionals.