-2

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

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
  • Is that the *entirety* of the error message, is there nothing before/after it? Is there a `hs_*.log` file anywhere that's generated? What version of Java do you use (what does `java -version` print)? Checkstyle 10 requires [at least Java 11 to run](https://checkstyle.sourceforge.io/#JRE_and_JDK). – Joachim Sauer Aug 04 '23 at 08:37

0 Answers0