What is Military Justice?

Legal Definition
Military justice is the body of laws and procedures governing members of the armed forces. Many states have separate and distinct bodies of law that govern the conduct of members of their armed forces. Some states use special judicial and other arrangements to enforce those laws, while others use civilian judicial systems. Legal issues unique to military justice include the preservation of good order and discipline, the legality of orders, and appropriate conduct for members of the military. Some states enable their military justice systems to deal with civil offenses committed by their armed forces in some circumstances.

Military justice is distinct from the imposition of military authority on a civilian population as a substitute for civil authority. The latter condition is generally termed martial law, and is often declared in times of emergency, war, or civil unrest. Most countries restrict when and in what manner martial law may be declared enforced.
-- Wikipedia