I'm using Pythons' subprocess
module to run a command.
The command is used to run java JAR file.
When I run it via terminal, it runs fine producing the desired output.
The JAVA command via terminal:
java -cp "*" -Xmx2g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,parse,dcoref,depparse -file input/input.txt
I've written a simple Python script to run the same command.
from subprocess import call
def main():
call(['java', '-cp', '\"*\"','-Xmx2g','edu.stanford.nlp.pipeline.StanfordCoreNLP','-annotators','tokenize,pos,lemma,ner,parse,dcoref,depparse', '-file', 'input/input.txt'])
Terminal Command (from the same folder where I ran the JAVA Command):
python script.py
Output here is:
Error: Could not find or load main class edu.stanford.nlp.pipeline.StanfordCoreNLP
I'm missing as to what is not same when I run it from python or run it from the terminal?
What is present in the terminals environment that pythons call()
misses out?
Any insight or direction would kick start my project!