线程"main"中的异常java.lang.OutOfMemoryError:Java堆空间

S G*_*ber 6 java eclipse stanford-nlp

我正在使用Eclipse来运行java程序类,而我运行它时遇到了这个错误

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Run Code Online (Sandbox Code Playgroud)

然后我从属性>运行> VM选项中更改了VM,然后我再次运行程序,出现了新的错误,

Error occurred during initialization of VM
Incompatible initial and maximum heap sizes specified
Run Code Online (Sandbox Code Playgroud)

我正在尝试在我的程序中应用stanford库,任何想法如何解决这个错误.

S G*_*ber 7

要更改Eclipse的VM,您可以从Windows> Preferences> Java> Installed JREs中更改MV的数量,选择JRE并单击edit,然后在Default VM Arguments:中写入-Xmx1024M或任何其他数量的内存. ..