The Jedi Code is the philosophy of the Jedi summed up in a paragraph. Every Jedi must know the Jedi Code, as it is the basis of all their training and therefore should be the first thing learned. The Jedi Code lays the basic foundations for a Jedi to build up future knowledge of the Force on.
The Jedi Code teaches a Jedi how to live along side the Force. Fear, Anger, Hate, aggression. These negative emotions lead to the Dark Side of the Force and so a Jedi is encouraged to learn to act without them.
"There is no emotion , there is peace.
There is no ignorance , there is knowledge.
There is no passion , there is serenity.
There ìs no chaos , there is harmony.
There is no death , there is the force."
This code contains the teachings of how to gain enlightenment with the Force and become one with the universe. The Light Side is sustained by life, and a Jedi acts to preserve life. Killing is ultimately wrong, and stains the soul, therefore the taking of a life is the very last resort for a Jedi. Killing is sometimes necessary, but should only ever be done in defence of yourself or the weak or good people. Killing should only be done to preserve life, not to take it - therefore if by killing someone it will be beneficial to the lives of others.
Enlightenment is reached by peace and harmony and as such a Jedi wishes to maintain peace and harmony. The world will always contain evil and negative energies. But it is a Jedi’s mission to stop the evil energies getting to powerful. Fear, anger, hatred. Such emotions are not used by a Jedi. A Jedi recognises the existence of such emotions, but the emotions have no control over a Jedi, therefore a Jedi will be able to make the right decision without emotions influencing him. The right decision can only be made when calm and at peace with the Force, therefore emotions must be pushed aside so as not to influence the result of your decision.
Jedi seek to solve problems as peacefully as possible, only fighting as a last resort. Of course Jedi learn how to fight, but this is so they will never need to fight. A Jedi always tries to solve a problem without violence, though some times this is the only option.
The Force should only ever be used for knowledge and defence, never attack. A Jedi who uses the Force for his personal gain is slowly leaning towards the Dark Side. Using the Force when it is not needed to be used, or to gain wealth or fame - these lead to the Dark Side. Jedi seek to serve and protect, not to rule and terrorise.