 Subsequently, on 30 December 1777, Maximilian III Joseph, Elector of Bavaria died without leaving any children.As a result, his territories were coveted by ambitious men, including Joseph, who tried to swap Bavaria for the Austrian Netherlands.This alarmed Frederick II of Prussia, and thus the War of Bavarian Succession erupted in 1778.