Hi Team, I have the jar files "wiremock-jre8-stand...
# wiremock-java
s
Hi Team, I have the jar files "wiremock-jre8-standalone-2.35.0" and "wiremock-webhooks-extension-2.35.0" in the folder, and when i try to run the command "java -cp wiremock-jre8-standalone-2.35.0.jar:wiremock-webhooks-extension-2.35.0.jar com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --extensions org.wiremock.webhooks.Webhooks". getting error as "Error: Could not find or load main class com.github.tomakehurst.wiremock.standalone.WireMockServerRunner Caused by: java.lang.ClassNotFoundException: com.github.tomakehurst.wiremock.standalone.WireMockServerRunner"
r
That suggests that you may have invalid copies of the jar files... it works for me. Where did you get the jar files from?
I downloaded them from maven central: https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.35.0/wiremock-jre8-standalone-2.35.0.jar https://repo1.maven.org/maven2/org/wiremock/wiremock-webhooks-extension/2.35.0/wiremock-webhooks-extension-2.35.0.jar Then in the directory I had downloaded them to I ran:
Copy code
java -cp wiremock-jre8-standalone-2.35.0.jar:wiremock-webhooks-extension-2.35.0.jar   com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --extensions org.wiremock.webhooks.Webhooks
Started up fine.
Just check they are actually in the directory where you are running, and the files have the correct name as in the
-cp
argument; if I run that same command outside the directory, or with the wrong file name in the
-cp
I get the error you do.
s
looks strange, i have followed the exact step which you mentioned. but still hitting the same error. Will do further tries and let you know if i able to succeed.
r
What operating system are you running?
And what JVM version?
s
Windows with java "java version "17.0.2" 2022-01-18 LTS"
r
I'll just check it on Windows
OK, reproduced it - windows doesn't like the
-cp
with a colon in it I think...
Try a semicolon:
Copy code
java -cp wiremock-jre8-standalone-2.35.0.jar;wiremock-webhooks-extension-2.35.0.jar com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --extensions org.wiremock.webhooks.Webhooks
s
cool, works now. You saved my day. Thank you
👍 1