Why was mercury onboard the U-864?

The deadly mercury cargo was to be used in the development of weapons to bolster Japan's efforts against the Allies in the Pacific war. This, it was hoped, would divert attention and assets from the European war and allow Germany to regroup and stay in the fight.