Home > Net >  JAVA_HOME is not defined correctly. We cannot execute
JAVA_HOME is not defined correctly. We cannot execute

Time:10-14

I have removed all old Java 8 files/folders and reinstalled Java 11 in my machine. However when trying to run neo4j, it shows JAVA_HOME is not defined correctly. Here are my folders/files of jvm

I have tried following some questions to edit the etc/profile file, but still no success in getting it to work.

CodePudding user response:

Newer Java versions don't define JAVA_HOME anymore. You removed Java 8 but the environment variable wasn't removed. Neo4j tries to find something in the folder defined in JAVA_HOME which points to your old Java installation. Since you removed that folder, you get an error saying it can't find the folder.

You'd need to change JAVA_HOME so it points to your new Java installation since Java doesn't do that automatically.

  •  Tags:  
  • java
  • Related