Croatia has had sub-replacement fertility for decades -- plus the migration of young people to other EU countries that offer higher salaries, or to Zagreb if they can't find a job in Denmark or Germany.
Japan has had sub-replacement fertility for decades -- plus the migration of young people from smaller cities and towns to Tokyo.
The end result is that small towns are, quite literally, dying. Small cities are emptying out. Rural regions are beginning to resemble retirement estates, complete with hobby farms.
The "solution" is immigration -- if you believe that people are perfectly fungible and that an Indonesian man will become accepted as Japanese, or a Lebanese man will become accepted as Croatian. I don't think that's going to happen in either place. In Croatia, I know a bunch of Chicagoans of Croatian descent who moved "back to the homeland." Nobody in Croatia accepts them as "real Croatians." They're going to be part of some expat community for life. It's going to be even worse with culturally distinct foreigners. And it's going to lead to trouble. If there's an elegant way to manage this, I'm not aware of it.