and what were they doing that we were so hostile to them before even pearl harbor?
Japan were allies with the Nazis, but they were not close. There is an image of the Axis powers being the mirror image of the Allies and they worked together. The reality was they were either allies by necessity or coerced into the alliance. Germany had closer ties to Nationalist or Kuomintang China. They trained Chinese soldiers and even invested more into industry in China. It wasn’t until Japan invaded China in 1938 in the Second Sino-Japanese War that Hitler decided to seek closer ties with Japan due to their already built military and their signature on the Anti-Comiterm Pact Of 1936.
Now Japan and Germany had closer ties and improved relations for most of 1938-39, Hitler thought he could use Japan in the upcoming war against Russia. However Japan did not want to face Russia after their undeclared border conflict with the USSR. After the battles of Lake Khasan and Khalkhin Gol the Japanese we’re defeated and signed a non aggression pact with the USSR. They knew they would not be ready for a war with Russia, lacking tanks and heavy artillery for the armies in Manchuria. While they did sign the Tripartite pact in 1940 with Italy and Germany there was no unified command or supreme commander of all the forces like in the West with Eisenhower. All three powers basically did what benefited them and not what benefitted the alliance. For example Japan and Italy were shocked about the non-aggression pact signed between Germany and the Soviet Union. Germany never talked to either powers beforehand before signing this, effective making the Anti Comiterm pact invalid. When Germany invaded Russia in 1941 they urged Japan to attack in Siberia. Japan however wanted to wait until imminent defeat was for sure for the USSR. Japan still knew it was not strong enough to beat Russia even with its attention drawn towards Germany. Japan just kept promising Germany it would attack eventually, waiting for the right moment. But as the war dragged on both sides could not help each other as both were embroiled in the war on their side of the world.
However Japan was facing a crisis itself, with its invasion into China stalled out and its seizure of French Indochina, combined with the US, UK, and Dutch East Indies cutting off exports to Japan in 1940. Japan was in a bind and could not last long from no imports from these powers. While it asked Germany to give blueprints for their synthetic fuel production, they declined this request.
Japan estimated that without its continued oil supply from the US, it would have only 12-18 months of fuel left before completely running out. Alongside other important resources it was cut off from like copper, aluminum, and iron ore for steel production, Japan was in a bad spot. This embargo was to curtail Japan’s expansion into Southeast Asia, however it had the opposite effect. Japan had two options: 1. End expansion into SE Asia and agree to the US and UK terms. Or 2. To go ahead with Nanshin-Ro or Southern Expansion doctrine.
This plan was to seize the Western powers colonies in the Pacific and kick them out of the Pacific in general. This would work out for Japan as this plan was favored by the Navy who had an inter-service rivalry with the Army. This would also favor Japan’s army as well, since many of the troops in the Western Powers colonies were Colonial troops. These were at best secondary troops lacking heavy weapons, tanks, and modern planes. Plus they would be cut off from any reinforcements or resupply due to Japan’s Navy superiority in the area. Even though Japan might not be able to compete with Russia or even US regular troops and tanks, they could definitely fight these colonial troops. The big prize was the Dutch East Indies which had a lot of oil and other natural resources like rubber. But first Japan had to stop its most immediate threat: the USA. Japan planned to take out the Pacific fleet in Pearl Harbor, with this force taken out they could take over South East Asia no problem. This would also mean that the US could not respond to the seizure of their territories such as the Philippines or Guam. With this they planned their attack and on December 7th, 1941 Japan attacked and devastated the Pacific Fleet. While the fleet was devastated, the oil supply on Pearl Harbor was untouched alongside the submarines docked there as well. Japan also failed to destroy the carriers which were not near Pearl Harbor at the time.
In conclusion Japan and Nazi Germany’s relations were good, however they had different ideas and plans that conflicted with each other at times. While they did cooperate with each other, it wasn’t enough to help win a war nor was it on the scale of the Allies.