To build a jar file, which I did with my ANTLR4 utility to check an Oracle Tnsnames.ora file, you just need to collect all the *.class files together into a jar file using the "jar" utility.
I have a bulk script for windows on Github at
https://github.com/NormanDunbar/Tnsnames_checker/blob/master/build.bat which you might want to look at. The applicable line is:
jar -cvf test\tnsnames_checker.jar *.class > nul
This is after that "javac" compile of all the *.java files obviously.
My build runs anltr4 on the two grammar files, compiles the generated *.jave files into *.class files, collects them into a single *.jar file, then deletes the *.class files.
It may not be the best or most efficient way, but it worked for me, and I'm not a java programmer at all! This was my first one.
Have fun.
Cheers,
Norm.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.