Question: I installed Java on my Raspberry Pi and it starts up really slow. Why is this happening?

```
# time java
..
real    0m1.356s
user    0m1.190s
sys     0m0.110s

```

**edit:** I was comparing to a Hello World c++ binary and it took 0m0.001s. Why is c++ binaries so much faster?

Answer: 
Raspberry Pi has a much slower processor than your computer so everything on it is going to run much slower than what you usually see.

EDIT\*

I would argue that C++ will be much faster because of the initial overhead that Java has in order to run. You need to account for the time it takes for the JVM to start as well as the fact that the C++ program is already compiled while the Java program is not.

It is important to note, however, that C++ is not always faster than Java. The JIT (just in time) compiler that is used by the JVM helps optimize your code while it is running.
Actually I didn't want to add an answer, as the existing answers are perfectly explaining your apple and pear comparison.

However, I think the fact that the JVM implementation has a [significant impact on performance](https://blogs.oracle.com/jtc/entry/comparing_jvms_on_arm_linux) needs more visibility.

I came here myself, as my Spring application needed 100 seconds to start. After switching from OpenJDK-8 to Oracle's Hotspot, startup took only 15 seconds. Hotspot for ARM is included in Raspbian:

```
apt-get install oracle-java8-jdk

```