문제

When attempting to run the below command:

java -classpath mycompanychecks.jar:checkstyle-5.7-all.jar \
 com.puppycrawl.tools.checkstyle.Main \
 -c config.xml -r .

I get the error:

Error: Could not find or load main class \

In the directory that I'm running the command from I do have the two jar files, and also I have checked that 'com.puppycrawl.tools.checkstyle.Main' does in fact reside in the 'checkstyle-5.7-all.jar'. As the error seems to refer to the backslash maybe it's a syntactical error? However I'm executing the command exactly as stated on the checkstyle page.

도움이 되었습니까?

해결책

This example you're trying is clearly not about Windows.

Check here:
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html

You need to use ; as separator to say the least.

So you need something like this (this is all one line).

java -classpath c:\test\mycompanychecks.jar;c:\test\checkstyle-5.7-all.jar com.puppycrawl.tools.checkstyle.Main -c config.xml -r .

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top