1

First let me clarify the question. I'm not asking how to sync environment variables. What I am asking is how to set JAVA_HOME so that when I call wsl echo `$JAVA_HOME from powershell it writes out the specified bash environment variable.

So far, I've tried setting the value in /etc/environments. I've also tried setting the value in ~/.bashrc and ~/.bash_profile. The command I'm executing in both of those startup scripts is: export JAVA_HOME="/path/to/java"

The WSL OS is Ubuntu 20.04.3

What am I missing. Surely there must be a way to set environment variables. If I execute something like wsl echo `$PATH, I get a value.

Jason Thompson
  • 403
  • 2
  • 6
  • 15

0 Answers0