Originally established as a colony of the Dutch Republic, Java remained in Dutch hands throughout the French Revolutionary and Napoleonic Wars, during which time the French invaded the Republic and established the Batavian Republic in 1795, and the Kingdom of Holland in 1806.