I found in GitHub a repository from antlr4 that has the complete grammar file for Java 8 which is here: https://github.com/antlr/grammars-v4/blob/master/java8/Java8.g4
If I use antlr4 it will take the grammar and create the lexer, the parser etc. But this is not enough to replicate the existing Java compiler.
We need Java code that will hook into the antlr4-generated classes (the lexer, parser, etc.) So that we can convert an input source file to byte code. There is a project in GitHub called minijava where the author created a compiler for a subset of Java which is here: https://github.com/csaroff/MiniJava-Compiler?files=1
Is there compiler code like the minijava project, but for the whole Java 8 grammar?