While both languages have ancient roots, Chinese has a continuous written history dating back to the Shang dynasty (c. 1600–1046 BCE). This means it has been used for written communication for over 3,000 years.
Japanese, on the other hand, developed later from contact with Chinese culture and language. While there are hints of Japanese language existing before the 5th century CE, it wasn't until the 7th and 8th centuries CE that it developed a writing system and truly began to flourish.
Therefore, Chinese is significantly older than Japanese.