When were the first jet engines used? I read a book about WW2 1 and saw a couple of planes with a giant jet engine on top of them, e.g. the Heinkel He 162 Salamander.

I realize jet engines had to have been invented before WW2 for that kind of technology to be used, so when were the first aircraft jet engines around? 

1 Aircraft of World War II: 300 of the World's Greatest Aircraft. Chris Chant.
The first aircraft jet engine was ground tested by Frank Whittle in April 1937. In September of the same year, Hans von Ohain (ground) tested his jet engine. 

The first jet aircraft, He 178 flew in August 1939.