I'm trying to run checkstyle on ubuntu by command line.
I've tried java -jar checkstyle-10.12.2-all.jar -c ./google_checks.xml <file_path>
but kept encountering Error: A JNI error has occurred, please check your installation and try again
.
So I reset CLASSPATH by export CLASSPATH="<path_to_jar>/checkstyle-10.12.2-all.jar"
, cloned checkstyle's git then ran again but the error occured again.
How do I solve this problem? I'm trying to do this without using IDEs or not as plug-ins.
If it's impossible, please give teach the commands I need to run checkstyle as maven plug-in. (I've already tried it but failed.)
Try:
export CLASSPATH="<path_to_jar>/checkstyle-10.12.2-all.jar"
java -jar checkstyle-10.12.2-all.jar -c ./google_checks.xml <file_path>
Expected: Convention checked results