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" (2:13-15). The Book of Nehemiah suggests that the priest-scribe Ezra brought the Torah back from Babylon to Jerusalem and the Second Temple (8-9) around the same time period. Both 1 and 2 Maccabees suggest that Judas Maccabeus (around 167 BCE) also collected sacred books (3:42-50, 2:13-15, 15:6-9).
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 (140-40 BCE), while others argue it was not fixed until the second century CE or even later.
Sirach provides evidence of a collection of sacred scripture similar to portions of the Hebrew Bible. The book, which dates from 180 BCE (and is not included in the Jewish canon), includes a list of names of biblical figures (44-49) in the same order as is found in the Torah and the Nevi'im (Prophets), and which includes the names of some men mentioned in the Ketuvim (Writings). Based on this list of names, some scholars have conjectured that the author, Yeshua ben Sira, had access to, and considered authoritative, the books of Genesis, Exodus, Leviticus, Numbers, Deuteronomy, Joshua, Judges, Samuel, Kings, Job, Isaiah, Jeremiah, Ezekiel, and the Twelve Minor Prophets.
His list excludes names from Ruth, Song of Songs, Esther and Daniel, suggesting that people mentioned in these works did not fit the criteria of his current listing of great men, or that he did not have access to these books, or did not consider them authoritative. In the prologue to the Greek translation of Ben Sira's work, his grandson, dated at 132 BCE, mentions both the Law (Torah) and the Prophets (Nevi'im), as well as a third group of books which is not yet named as Ketuvim (the prologue simply identifies "the rest of the books").
According to Michael Barber, in the Septuagint, the Torah and Nevi'im are established as canonical, but the Ketuvim appear not to have been definitively canonized yet. The translation (and editing) work might have been done by seventy (or seventy-two) elders who translated the Hebrew Bible into Koine Greek but the historical evidence for this story is rather sketchy. Beyond that, according to him, it is virtually impossible to determine when each of the other various books was incorporated into the Septuagint.
Philo and Josephus (both associated with first-century Hellenistic Judaism) ascribed divine inspiration to its translators, and the primary ancient account of the process is the circa 2nd-century BCE Letter of Aristeas. Some of the Dead Sea Scrolls attest to Hebrew texts other than those on which the Masoretic Text was based; in some cases, these newly found texts accord with the Septuagint version.
The theory that there was a closed Hebrew canon of Second Temple Judaism was further challenged by the textual variants found in the Dead Sea Scrolls. Michael Barber writes, "Up until recently it was assumed that "apocryphal" additions found in the books of the LXX represented later augmentations in the Greek to the Hebrew texts. In connection with this, the Masoretic text (MT) established by the rabbis in the medieval period has been accepted as the faithful witness to the Hebrew Bible of the 1st century. Yet, this presupposition is now being challenged in light of the Dead Sea Scrolls."
Evidence that supports these challenges include the fact that "copies of some Biblical books found at Qumran reveal sharp divergences from the MT." As an example of such evidence, Barber asserts that "scholars were amazed to find that the Hebrew copies of 1 and 2 Samuel found in Cave 4 agree with the LXX against the MT. One of these fragments is dated into the third century BCE and is believed to be the very oldest copy of a biblical text found to date. Clearly the Masoretic version of 1-2 Samuel is significantly inferior here to the LXX exemplar."
The Dead Sea scrolls refer to the Torah and Nevi'im and suggest that these portions of the Bible had been canonized earlier. A scroll that contains all or parts of 41 biblical psalms, although in a different order than in the current Book of Psalms and which includes eight texts not found in the Book of Psalms, suggests that the Book of Psalms had not yet been canonized. See also Psalms 152-155.
In the 1st century CE, Philo Judaeus of Alexandria discussed sacred books, but made no mention of a three part division of the Bible; though his De vita contemplativa  (sometimes suggested in the 19th century to be of later, Christian, authorship) does state at III(25) that "studying... the laws and the sacred oracles of God enunciated by the holy prophets, and hymns, and psalms, and all kinds of other things by reason of which knowledge and piety are increased and brought to perfection." Philo quotes almost exclusively from the Torah, but occasionally from Ben Sira and Wisdom of Solomon.
According to Michael Barber, the earliest and most explicit testimony of a Hebrew canonical list comes from Josephus (37CE - c. 100CE). Josephus refers to sacred scriptures divided into three parts, the five books of the Torah, thirteen books of the Nevi'im, and four other books of hymns and wisdom: "For we have not an innumerable multitude of books among us, disagreeing from and contradicting one another [as the Greeks have], but only twenty-two books, which contain all the records of all the past times; which are justly believed to be divine; and of them five belong to Moses, which contain his laws and the traditions of the origin of mankind till his death... the prophets, who were after Moses, wrote down what was done in their times in thirteen books. The remaining four books contain hymns to God, and precepts for the conduct of human life."
Since there are 24 books in the current Jewish canon instead of the 22 mentioned by Josephus, some scholars[who?] have suggested that he considered Ruth part of Judges, and Lamentations part of Jeremiah. Other scholars[who?] suggest that at the time Josephus wrote, such books as Esther and Ecclesiastes were not yet considered canonical.
According to Gerald A. Larue, Josephus' listing represents what came to be the Jewish canon, although scholars were still wrestling with problems of the authority of certain writings at the time that he was writing. Significantly, Josephus characterizes the 22 books as canonical because they were divinely inspired; he mentions other historical books that were not divinely inspired and that he therefore did not believe belonged in the canon.
Barber agrees that although "scholars have reconstructed Josephus' list differently, it seems clear that we have in his testimony a list of books very close to the Hebrew canon as it stands today." However, he avers that Josephus' canon is "not identical to that of the modern Hebrew Bible". He points out that it is debatable whether or not Josephus' canon had a tripartite structure. And thus, Barber warns that "one should be careful not to overstate the importance of Josephus." In support of this caveat, he points out that "Josephus was clearly a member of the Pharisaic party and, although he might not have liked to think so, his was not the universally accepted Jewish Bible--other Jewish communities included more than twenty-two books."
Make public the twenty-four books that you wrote first, and let the worthy and the unworthy read them; but keep the seventy that were written last, in order to give them to the wise among your people.
The Pharisees also debated the status of canonical books. In the 2nd century CE, Rabbi Akiva declared that those who read non canonical books would not share in the afterlife (Sanhedrin 11:1, Talmud 90a). But, according to Bacher and Grätz, Akiva was not opposed to a private reading of the Apocrypha, as is evident from the fact that he himself makes frequent use of Sirach.
They also debated the status of Ecclesiastes and Song of Songs concluding like the tradition of Rabbi Simeon ben Azzai that they are Holy (Yadayim 3:5). Akiva stoutly defended, however, the canonicity of the Song of Songs, and Esther. But Heinrich Graetz's statements respecting Akiva's attitude toward the canonicity of the Song of Songs are misconceptions, as I.H. Weiss has to some extent shown. He was antagonistic toward the Septuagint text family and the apocryphal books contained therein, since Christians drew many proofs from them.
The Mishnah, compiled at the end of the 2nd century CE, describes a debate over the status of some books of Ketuvim, and in particular over whether or not they render the hands ritually impure. Yadaim 3:5 calls attention to a debate over Song of Songs and Ecclesiastes. The Megillat Ta'anit, in a discussion of days when fasting is prohibited but that are not noted in the Bible, mentions the holiday of Purim. Based on these, and a few similar references, Heinrich Graetz concluded in 1871 that there had been a Council of Jamnia (or Yavne in Hebrew) which had decided Jewish canon sometime in the late 1st century (c. 70–90). This became the prevailing scholarly consensus for much of the 20th century.
W. M. Christie was the first to dispute this popular theory in the July 1925 edition of The Journal of Theological Studies in an article entitled "The Jamnia Period in Jewish History".Jack P. Lewis wrote a critique of the popular consensus in the April 1964 edition of the Journal of Bible and Religion entitled "What Do We Mean by Jabneh?"Raymond E. Brown largely supported Lewis in his review published in the Jerome Biblical Commentary (also appears in the New Jerome Biblical Commentary of 1990), as did Lewis' discussion of the topic in 1992's Anchor Bible Dictionary. Sid Z. Leiman made an independent challenge for his University of Pennsylvania thesis published later as a book in 1976, in which he wrote that none of the sources used to support the theory actually mentioned books that had been withdrawn from a canon, and questioned the whole premise that the discussions were about canonicity at all, stating that they were actually dealing with other concerns entirely. Other scholars have since joined in and today the theory is largely discredited.
Some scholars argue that the Jewish canon was fixed earlier by the Hasmonean dynasty.Jacob Neusner published books in 1987 and 1988 that argued that the notion of a biblical canon was not prominent in 2nd-century Rabbinic Judaism or even later and instead that a notion of Torah was expanded to include the Mishnah, Tosefta, Jerusalem Talmud, Babylonian Talmud and midrashim. Thus, there is no scholarly consensus as to when the Jewish canon was set.
Sirach... knew the Law and Prophets in their present form and sequence; for he glorifies (ch. xliv.-xlix.) the great men of antiquity in the order in which they successively follow in Holy Writ. He not only knew the name [Hebrew omitted] ("The Twelve Prophets"), but cites Malachi iii. 23, and is acquainted with by far the greatest part of the Hagiographa, as is certain from the Hebrew original of his writings recently discovered. He knew the Psalms, which he ascribes to David (Ecclus. [Sirach] xlvii. 8, 9), and the Proverbs: "There were those who found out musical harmonies, and set forth proverbs [A. V., "poetical compositions"] in writing" (xliv. 5). An allusion to Proverbs and probably to the Song of Solomon is contained in his words on King Solomon: "The countries marveled at thee for thy songs, and proverbs, and parables [or "dark sayings"], and interpretations" (xlvii. 17); the last three words being taken from Prov. i. 6, while the Song of Solomon is alluded to in "songs." He would have had no authority to speak of "songs" at all from I Kings v. 12; he must have known them. While he had no knowledge of Ecclesiastes, his didactic style proves that he used Job, as is also indicated by the words [Hebrew omitted] (xliv. 4, and afterward, [Hebrew omitted]). Ecclesiastes, Esther, and Daniel are not included in his canon (see Halévy, "Etude sur la Partie du Texte Hébreux de l'Ecclésiastique," pp. 67 et seq., Paris, 1897); he considers Chronicles and Ezra-Nehemiah as Holy Scripture (xlix. 12 = Ezra iii. 2; xlix. 13 = Neh. iii. and vi.; compare Neh. vi. 12); he mentions distinctly "the laws and prophets" (xxxix. 1); in the following sentences there are allusions to other writings; and verse 6 of the same chapter leads to the supposition that in his time only wisdom-writings and prayers were being written.