medcl / elasticsearch-rtf

elasticsearch中文发行版,针对中文集成了相关插件,方便新手学习测试.
Apache License 2.0
2.67k stars 715 forks source link

第一次接触elasticSearch,win10下 Exception in thread "main" java.lang.ExceptionInInitializerError #69

Open HubMatthewTan opened 7 years ago

HubMatthewTan commented 7 years ago

昨天的问题,没人回答,自己捣鼓一天,终于弄明白了,回来说一下:大致原因是jdk9对elasticSearch不太友好(版本太新),我使用了JDK8u152就没有问题了,请大家注意。 这是网上的原话,我摘录如下:

问题: $> elasticsearch Java HotSpot(TM) 64-Bit Server VM warning: Option UseParNewGC was deprecated in version 9.0 and will likely be removed in a future release. Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. Exception in thread "main" java.lang.ExceptionInInitializerError at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:190) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32) Caused by: java.lang.UnsupportedOperationException: Boot class path mechanism is not supported at java.management/sun.management.RuntimeImpl.getBootClassPath(RuntimeImpl.java:99) at org.elasticsearch.monitor.jvm.JvmInfo.(JvmInfo.java:77)

结论: 废弃的GC选项已被移除( JEP 214 )。 在 JDK 8( JEP 173 )中已经弃用了一些详细的 GC 选项和选项组合。这些将不会被识别,并将导致 JVM 在启动时中止。要注意的选项如下所示 -XX:-UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Xincgc -XX:+CMSIncrementalMode -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseConcMarkSweepGC -XX:-UseParNewGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSFullGCsBeforeCompaction -XX:+UseCMSCollectionPassing 在 JDK 9 中,concurrent-mark-sweep (iCMS) 的增量模式已被移除,目前的计划是在 JDK 10 中完全删除 CMS。。。