Court-martial
There are four levels of military jurisdiction:

Military Court (Pengadilan Militer), composed of one major as presiding judge, two captains as judge, one captain as military prosecuting attorney, and one second lieutenant as clerk of court.
High Military Court (Pengadilan Militer Tinggi), composed of one lieutenant colonel as presiding judge, two majors as judge, one major as military prosecuting attorney, and one captain as clerk of court.
Supreme Military Court (Pengadilan Militer Utama), composed of one colonel as presiding judge, two lieutenant colonels as judge, one lieutenant colonel as military prosecuting attorney, and one major as clerk of court.
Warzone Military Court (Pengadilan Militer Pertempuran), composed of one colonel as presiding judge, two lieutenant colonels as judge, one lieutenant colonel as military prosecuting attorney, and one major as clerk of court. This level of military court only applies during wartime.
The judges will receive temporary rank the same as the defendant if the rank of the defendant is higher than the judges.

Luxembourg: In Luxembourg, there are three levels of military jurisdiction:

The lowest is the Council of War which is composed of one lieutenant-colonel (or higher), one captain (or higher) and one civilian judge of a District Court.
The Military Court of Appeal is composed of two high magistrates of a civilian Court of Appeal and one Major (or higher).
At the top is the Military High Court which deals not only with military cases, but also with acts of high treason, sabotage, organized forms of terrorism and crimes against humanity. It is composed of two magistrates of a civilian Court of Appeal, one judge of a civilian District Court and one Lieutenant-Colonel (or higher) of the Army.

Netherlands: In the Netherlands, members of the military are tried by a special military section of the civilian court in Arnhem. This section consists of a military member and two civilian judges. The decision whether or not to prosecute is primarily made by the (civilian) attorney general.

New Zealand: Service members of the New Zealand Defence Force are tried under a court martial for offences pertaining to the most serious offences against the Armed Forces Discipline Act 1971. Offences such as mutiny, murder, sexual offences, serious assaults, drug offences, or offences where the maximum punishment exceeds a 7-year prison term will be heard by court martial. Below this 7-year threshold the accused is dealt with by their commanding officer in what is known as a summary trial.
During court martial the appointed judge is either a New Zealand High Court or District Court judge and they preside over the trial. Defendants are assigned legal counsel, and for the prosecution, a lawyer is assigned who generally comes from a military background. The judge advocate is usually made up of senior NZDF officers and warrant officers who hear the defence and prosecution evidence during court martial. Punishment on guilty findings of a defendant will see them face being charged with a punishment such as serious reprimand, loss of rank, dismissal from the NZDF, or being sent to military or civilian prison.

Poland: In Poland, military courts are military garrison courts and military district courts. They are criminal courts with jurisdiction over offences committed by soldiers in active military service, as well as certain offences committed by civilian military personnel and soldiers of the armed forces of foreign countries (Article 647 of the Code of Criminal Procedure). Garrison courts rule in the first instance, appeals against their decisions and orders are heard by district courts, which also have first-instance jurisdiction in the most serious cases. The Criminal Chamber of the Supreme Court then acts as the second instance; in addition, cassation appeals against judgments rendered in the second instance are heard in the Criminal Chamber. The military courts are therefore subject to the adjudicatory supervision of the Supreme Court (which, by the way, follows from Article 183(1) of the Constitution of the Republic of Poland), and the Minister of Justice has superior organizational and administrative supervision.

Philippines: In 2005, ex-AFP Major General Carlos Garcia (PMA Class of 1971, assigned comptroller of the AFP was court martialled for violating two articles of the Articles of War for the alleged Php 303 million Peso Money Laundering/Plunder and direct Bribery against him.

Singapore: Under the Singapore Armed Forces Act, any commissioned officer is allowed to represent servicemen when they are tried for military offences in the military courts. The cases are heard at the Court-Martial Centre at Kranji Camp II. Some of the courts martial in Singapore include that of Capt. G. R. Wadsworth in 1946 due to use of insubordinate language and, in the modern day, misbehaviour by conscripted servicemen.

Thailand: The governing law in Thailand's military courts is the Military Court Organisation Act 1955 (Thai: พระราชบัญญัติธรรมนูญศาลทหาร พ.ศ. ๒๔๙๘). The act allows the Judge Advocate General of Thailand (Thai: เจ้ากรมพระธรรมนูญ) to establish court regulations. In wartime or during the imposition of martial law, military courts may adopt special procedures.

United Kingdom: The court martial is one of the Military Courts of the United Kingdom. The Armed Forces Act 2006 establishes the court martial as a permanent standing court. Previously courts-martial were convened on an ad hoc basis with several traditions, including usage of swords. The court martial may try any offence against service law. The court is made up of a judge advocate, and between three and seven (depending on the seriousness of the offence) officers and warrant officers. Rulings on matters of law are made by the judge advocate alone, whilst decisions on the facts are made by a majority of the members of the court, not including the judge advocate, and decisions on sentence by a majority of the court, this time including the judge advocate.

United States: Most commonly, courts-martial in the United States are convened to try members of the U.S. military for violations of the Uniform Code of Military Justice (UCMJ), which is the U.S. military's criminal code. However, they can also be convened for other purposes, including military tribunals and the enforcement of martial law in an occupied territory. Courts-martial are governed by the rules of procedure and evidence laid out in the Manual for Courts-Martial, which contains the Rules for Courts-Martial, Military Rules of Evidence, and other guidance. There are three types: Special, Summary, and General.

Fictional examples: In Herman Melville's novella Billy Budd (first published 1924), the title character is convicted at a drumhead court-martial of striking and killing his superior officer on board HMS Indomitable, is sentenced to death, and is hanged. The novella has been adapted for the stage, film and television; notably in Benjamin Britten's 1951 opera Billy Budd.
In C.S. Forester's 1938 novel Flying Colours, Captain Horatio Hornblower is court-martialled for the loss of HMS Sutherland. He is "most honourably acquitted".
In Michael Morpurgo's novel Private Peaceful, the main character of "Tommo" reflects on the childhoods of himself and his brother, Charlie as Charlie awaits a court martial during WWI, which he receives at the end of the story for disobeying orders and cowardice in the face of the enemy.
Several courts-martial occur in the British naval TV series Warship, including notably that of Lieutenant Palfrey, a Royal Marines officer accused of killing a foreign officer during a military exercise, and that of Fleet Air Arm pilot Edward Glenn, brother of Alan Glenn, one the principal characters, charged with a range of offences relating to a dangerous flight manœuvre.
In the Star Trek: The Next Generation episode "The Battle" it was stated that, as the loss of a starship was a court martial offense, Picard was court-martialled for the loss of the Stargazer, zealously prosecuted by Phillipa Louvois. In the end, he was absolved of all charges.
The 1992 movie A Few Good Men (and the play on which it was based) deals almost entirely with the court martial of two enlisted Marines.
In the 2008 to 2014 sci-fiction animated TV show "Star Wars: The Clone Wars's 2011 fourth season's episode "Plan of Dissent" clone troopers Fives and Jesse, both serving in the Grand Army of the Republic, act against orders from their acting superior in a war situation and in revenge are threatened with court-martial and consequent execution. They found themselves court-martialed and about to be executed by firing squad in the next episode, although the final execution did not happen despite them being found guilty

See also: Cashiering
Military trial films

References: 

Notes: 

Citations: 

Sources: 

Further reading: Macomb, Alexander, Major General of the United States Army, The Practice of Courts Martial, (New York: Harper & Brothers, 1841) 154 pages.
Macomb, Alexander, A Treatise on Martial Law, and Courts-Martial as Practiced in the United States.