By 1617 , it was apparent that Matthias , Holy Roman Emperor and King of Bohemia , would die without an heir , with his lands going to his nearest male relative , his cousin Archduke Ferdinand II of Austria , heir-apparent and Crown Prince of Bohemia .
He became Ferdinand II , Holy Roman Emperor .