Development of the Hebrew Bible canon
From The Art and Popular Culture Encyclopedia
Rabbinic Judaism recognizes the 24 books of the Masoretic Text, commonly called the Tanakh or Hebrew Bible, as authoritative. Modern scholarship suggests that the most recently written are the books of Jonah, Lamentations, and Daniel, all of which may have been composed as late as the second century BCE.
The Book of Deuteronomy includes a prohibition against adding or subtracting, which might apply to the book itself (i.e. a "closed book," a prohibition against future scribal editing) or to the instruction received by Moses on Mt. Sinai.
The book of 2 Maccabees, itself not a part of the Jewish canon, describes Nehemiah (around 400 BCE) as having "founded a library and collected books about the kings and prophets, and the writings of David, and letters of kings about votive offerings". The Book of Nehemiah suggests that the priest-scribe Ezra brought the Torah back from Babylon to Jerusalem and the Second Temple around the same time period. Both 1 and 2 Maccabees suggest that Judas Maccabeus (around 167 BCE) also collected sacred books.
There is no scholarly consensus as to when the Hebrew Bible canon was fixed: some scholars argue that it was fixed by the Hasmonean dynasty, while others argue it was not fixed until the second century CE or even later.