In 1856, he joined the Austro-Hungarian Navy (Kriegsmarine) as a provisional sea cadet. He served in the Austro-Sardinian War. From 1860 to 1862, he served on the frigate Radetzky under the command of Admiral Tegetthoff.