The judges are elected by the U.N. General Assembly and the U.N. Security Council, and must receive an absolute majority from both in order to take office. The ICJ has jurisdiction only over states that have consented to it. It follows that the court cannot hear a dispute between two or more state parties when one of the parties has not accepted its jurisdiction. This can happen even where the nonconsenting party adheres to the court's statute, since mere adherence to the statute does not imply consent to its tribunals. I.C.J. Stat. art.
States can accept the court's jurisdiction in several different ways.
First, they can consent to jurisdiction on an ad hoc basis, which means that they negotiate a special agreement to let the ICJ decide a particular case at hand. This form of acceptance is mainly exercised in disputes that arise out of the interpretation or application of a treaty. Many states have accepted the court's jurisdiction under the Optional Clause. A few states have done so with certain restrictions. This reservation allows states a way out of the court's jurisdiction previously accepted under the Optional Clause if they decide not to respond to a particular suit.