The Kriegsmarine didn't have to use only their own merchant ships, they did conquer a significant number of countries that border the Mediterannean, thus giving them not the French or Italians more responsibility in supplying their own Afrika Korps themselves.
If the japs did invest heavily in it, why didn't they have they experience the success that a nation like germany did? they suffered similar losses and size of the fleets