A simple example usage of the Bayesian Classifier contained in my JavaBayesianClassifier repo.
I trained a version of this to classify Java, Python, C, C++, VB.Net files and it works fairly well. It worked much better on Fiction of course and was easily able to tell the difference between Jane Austen and Virginia Wolfe after being trained on several text files from Project Gutenberg.
The main method is in DocumentClassifier.java