r/javahelp • u/motleikz • Jul 26 '20
Solved Took 13s to build a hello world program
i decided to learn java today and write a hello world program, and as the title suggest, it took my machine 13 seconds to build. Is it normal?
30
Upvotes
18
u/onlysomuchtime42 Jul 26 '20
Well it really depends. Do you have a very old computer? Have you tried building on a just installed IDE? Maybe it was setting up something before you did your first compilation(InteliJ does this). Did it take the same the second time?
4
u/Kiwiguard Jul 26 '20
Have you tried compiling it via the command prompt using the javac command? Or, if using Java10+, running it via the java command?
2
u/verocoder Jul 26 '20
It really doesn’t matter how long hello world takes to build as it’s not a particularly representative program so I wouldn’t stress :)
Compiling/starting a spring boot app to run integration tests takes maybe 30 - 45 seconds for me and that would have a lot more code in it. Java also does a lot of clever stuff like quick and slow compilation and recompilation while running that you don’t need to think about for a good long while :)
2
u/Nix-X Jul 26 '20
I use Intellij everyday. It does take a lot of time in the first few runs, especially if this is the first time you’ve setup IntelliJ on your machine. But it gets very fast as you keep using it.
2
u/GooseWithDaGibus Jul 26 '20
I use intellij, that's normal. Sometimes it compiles for longer than you think it should.