The reference for the command line indicates that you should include more than just one jar in the classpath. They use all distributed jars (*).
Depending on your Java's version (8 or higher) you should also specify a modules directive.
edit
I further investigated the situation and it is rather messy.
The distribution includes some third party libraries as well as their source code in JAR format. Other libraries are not included at all, though they are referenced in the pom.xml (and downloaded if you have the tools).
A key problem is that the JAXB Apis/Impl are not part of the Java 11 package anymore and that the code is undergoing some mutations on its way to Jakarta EE. The Java 8 still includes a JAXB implementation, though the distribution includes newer standalone files. The code has a dependency on the class com.sun.istack.FinalArrayList
which is not included in the distribution but in the older com.sun.xml.bind:jaxb-core that is referenced in the POM.
Solution
You need to download the utility JAR istack-commons-runtime-3.0.7.jar
(try https://mvnrepository.com/artifact/com.sun.istack/istack-commons-runtime).
I placed it in a subdirectory "m2" and referenced it in the script as REPO.
I wrote a little Windows cmd script to start the processing.
REM run the Stanford CoreNLP on an input file
@echo off
SET JARS=stanford-corenlp-4.2.0.jar;stanford-corenlp-4.2.0-models.jar
SET JARS=%JARS;jollyday.jar;xom.jar;joda-time.jar;ejml-core-0.39.jar
SET JARS=%JARS%;ejml-ddense-0.39.jar;ejml-simple-0.39.jar;slf4j-api.jar
SET JARS=%JARS%;slf4j-simple.jar;protobuf.jar;javax.activation-api-1.2.0.jar
SET JARS=%JARS%;jaxb-api-2.4.0-b180830.0359.jar;jaxb-impl-2.4.0-b180830.0438.jar
SET REPO=m2
SET JARS=%JARS%;%REPO%istack-commons-runtime-3.0.7.jar
@echo on
java -Xmx3g -cp %JARS% edu.stanford.nlp.pipeline.StanfordCoreNLP -file %1
I placed this script into the directory where I extracted the distribution ZIP.
Now I can open a Windows Command Prompt, navigate to the distribution directory and start my script, passing the input file as parameter (the %1 in the script).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…