Windows Subsystem for Linux not recognizing JAVA_HOME Environmental Variable

As Biswapriyo suggested, you should use WSLENV.

  1. Open PowerShell. Then set JAVA_HOME to the path to your java installation.

  2. In your case, run setx JAVA_HOME "D:\Program Files\Java\jdk-11.0.1"

You should see a message that says “SUCCESS: Specified value was saved”.

  1. Then run setx WSLENV "JAVA_HOME/p".

You should see the success message again.

  1. Type ‘env’ into your WSL bash prompt.

You should see JAVA_HOME correctly set at this point.

Note: If step 2 doesn’t work, you might want to changing the path to JAVA_HOME to include the \bin folder.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)