diff --git a/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java b/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java index 345513d7f34..e05c94f590e 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java @@ -288,6 +288,9 @@ final class Bootstrap { // fail if using broken version JVMCheck.check(); + // fail if somebody replaced the lucene jars + checkLucene(); + INSTANCE.setup(true, settings, environment); INSTANCE.start(); @@ -364,4 +367,11 @@ final class Bootstrap { private static void exit(int status) { System.exit(status); } + + private static void checkLucene() { + if (Version.CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) == false) { + throw new AssertionError("Lucene version mismatch this version of Elasticsearch requires lucene version [" + + Version.CURRENT.luceneVersion + "] but the current lucene version is [" + org.apache.lucene.util.Version.LATEST + "]"); + } + } }