How does Austria have a navy?
WW1 Austria had a coastline on the Adriatic.
Prior to WW1 The Austria-Hungary Empire had access to the Adriatic Sea.
It did in 1914!
Captain Von Trapp was a WWI U-boat skipper in the Austro-Hungarian Imperial Navy. Was there most successful sub skipper - sank 14 Allied ships!
Present day Croatia,Slovenia, and Bosnia-Herzegovina were part of the Austro-Hungarian Empire. The home port of their navy was Pola, Croatia, but they also had Trieste, which is now part of Italy.
Even funnier than that, Switzerland still has a navy to this day. It only operates on lakes, but still, it’s a navy!
It dooesnt, now. Austria Hungary, as it existed when Count Von Trapp would have served, was much larger and reached to water.

The Empire was broken up after its defeat in WW-I
CAPT Georg von Trapp was a hero of the empire, and a very successful submarine commander. The fact that he was on "the other side" should take nothing from our admiration of the man. The movie and stage-play "The Sound of Music" makes passing reference to his naval service, but definitely centers on Hitler's interest in having him come out of retirement and join the Kriegsmarine. Von Trapp was an Austrian patriot ... and therefore absolutely not a NAZI.
To the Last Salute is well worth the read, if you really want to know something about the Austrian Navy.
The same way a US Navy ship might get a Captain from Nebraska...Austrians could join the German navy.
I always smirked at that despite knowing better. But I’d like to know how I have an ancestor who in the Swiss navy.