Stanfordcore Nlp invalid maximum heap size error
Do you use 64-bit Java? 
It depends on the OS you are using, but with 32-bit Java, you can't usually give all 4g for the heap.
i have the following error when i run the command  java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000 in folder of stanford core nlp
i have installed java runtime environment:
Invalid maximum heap size: -Xmx4g
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.