Although Q's explanation was found referenced, this one from Veg Paradise is a little more fleshed out so to speak...
Naming the Walnut
The origin of the word nut is derived from the Latin nux referring to the fruit inside the shell, the nut kernel itself. The walnut tree's formal botanical name, Juglans regia, comes from the Romans. The word juglans, from the Latin, means "the acorn of Jupiter," while regia refers to royalty. You could actually translate its Latin name to mean "the royal acorn of Jupiter."
Another Roman version, Jovis glans, though not its botanical name, is translated as the royal nut of Jove, another name for Jupiter who is the highest god in Roman mythology. Yet another Roman name for the walnut, Nux juglandes, translates as "the nut of Jupiter."
Because the walnut shell has an appearance reminiscent of the human brain, the Afghanistani word for walnut is charmarghz or "four brains" in their language.
From Teutonic roots comes the German Wallnuss or Welsche Nuss. Since many words of our English language came from the German, it's quite apparent how the word wallnuss could have easily evolved into "walnut."