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: 
There are two limiting factors about the startupspeed:

1. Software
	1. The distribution, you have installed. There are distributions out there, which has to emulate some operations (soft-ABI)
	2. The Java-Version
	3. The application, you want wo start
2. Hardware
	1. The raspberry pi is SLOW, it has only 256MB (512MB) of RAM. This is sharedwith the grafic processor (most ~50MB or more)
	2. There is only one CPU with ~800MHTz
	3. The CPU is an ARM (which is slower than an x86) \*)

Th first time I started Java (a tomcat web server), it needed around 5min to start. On my PC, it needs ~15sec

**update**
The updated question gives the answer.
You compare a native compiled hello world with the startup of a complete virtual maschine.

I think, you will always get an increditable worse start performance for (the first) starting Java-application. 

The second java-process may use shared memory with the first one, so a second application may start faster.

\*) I think it is slower, I have no benchmark about it
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.