How to run Solr 7.2.1 with Java 10 or later

Akitogo Team, 27 Sep 2018

You are maybe forced to use a Solr version less than 7.3 with Java 10 or Java 11. If you try to start Solr you will receive this message:

Your current version of Java is too old to run this version of Solr
We found version 10.0.2, using command '/usr/lib/jvm/java-10-oracle/bin/java -version', with response:
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
Please install latest version of Java 1.8 or set JAVA_HOME properly.

As you see from the output your Java version is newer than the minimum requirement but Solr will not start. There is a bug in how java version is checked which was fixed in Solr 7.3. So we simply replace the solr file in your /solr/bin directory. Just go there and do:
curl -o solr. This applies to Linux. On Windows you probably have to replace solr.cmd (not tested)