Q:

why c is preferred instead of java in most of the real time application

Why is C preferred instead of Java in most of the real time applications? For example, air-line system. I want some reasons except that Java is little slow.

A:

There are a number of reasons: 

History - the airline system is older than Java.  It might need a rewrite, but it's not in progress today that I know of.
Real time generally steers clear of garbage collection, because you can't have the system waiting at a delicate juncture for the GC thread to finish its work.  Things have to be more deterministic in real time control situations.  This would be true of Java, C#, and any other language that uses GC.  

There is a real time version of Java, but I don't know how widely it's used.
I'm not sure that the conclusion of C/C++ always being faster than Java is still true for JDK 6.  A lot has changed since the 1.0 version when a lot of the benchmarks were performed (e.g., faster object creation, new memory model, new generational GC algorithms, revised reflection, etc.).

A:

It's not about slowness at all here. It's about determinism and safety. Java, while normally fast, can hang for a microsecond when garbage collector decides to run and halt the execution for a second. If garbage collector ran while expanding airplane gear just before touching down at 150mph, bad things could happen.
C with explicit memory allocation is much more deterministic and programmer has full control over when exactly and how much memory is freed/allocated and can decide not to free memory while performing safety critical operation.
Currently new critical systems are written not even in C, but in safer languages, like ADA. Which is just as deterministic as C and (from type safety point of view) much safer even than Java.

A:

One of the biggest reasons is that C does not have garbage collection.  Garbage Collection is great because you don't have to worry deallocating memory and memory leaks are less of a problem, but it may take 100 ms or more to do the garbage collection.  In many applications this time is insignificant, but this means that your app can't do anything else during that 100 ms.  In certain real time applications this is unacceptable.  For more information read this:
http://java.sun.com/javase/technologies/realtime/faq.jsp#2

