I was installed latest version of ElasticSearch (8.6.2) and it worked fine. Then i realized that i need an older version (8.4.0), so i uninstalled it and then installed the older one.
Now when i try to start it it fails. In logs (/var/log/elasticsearch/elasticsearch.log) i found the error message - java.lang.IllegalArgumentException: Could not load codec 'Lucene95'. Did you forget to add lucene-backward-codecs.jar?
.
What to do? I am not used to java, and its libraries. So i dont even know from what to start.
As if found before the advise to download https://dlcdn.apache.org/lucene/java/9.5.0/ lucene9.5.0 and copy it`s folders into /lib directory. I tried it, but it didnt help me.
As far as I understood, the issue was in not deleted libraries that were installed by the highest version. And the older version tried to use them. After I removed them, and reinstalled the older version, it started. sudo rm -rf /var/lib/elasticsearch/ sudo rm -rf /etc/elasticsearch