I have installed neo4j5.16.0 and it was working fine with java11. I downloaded apoc of version 5.17 instead of 5.16 and restarted the neo4j server. This caused a java unsupported error. The error persist even after removing the apoc jar file. How to resolve?
Can you provide the log that shows the exception?
Did you modify the neo4j.conf file? It checks this for errors at startup.
Neo4j 5.x is incompatible with java 11, you need to use java 17 or java 21.
I don't know how you were able to get neo4j 5.16.0 started with java 11, because that would also give you the same error about incompatible java. I suspect there is java 17 or 21 somewhere on your machine already that the old neo4j process was somehow configured to use.
Anyway the solution is to make sure java 17 (or 21) is installed and make that the default java. The java distributor should have instructions for doing that with whatever operating system you are using.