I am annoyed trying this but all I am trying to do is set JAVA_HOME in /etc/environment file in Bash shell on Windows which is being offered now with Windows. My local Java is at C:\Program Files\Java\jdk1.8.0_91 so in my /etc/environment I am putting
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" export JAVA_HOME="/mnt/c/Program\ Files/Java/jdk1.8.0_91/"
Read online that to specify a space, one should use
\. On doing this:
cd /mnt/c/Program\ Files/Java/jdk1.8.0_91/
I can navigate to directory but on putting the same in /etc/environment file and sourcing it, if I run
echo $JAVA_HOME /mnt/c/Program\ Files/Java/jdk1.8.0_91/
I can tell that it is incorrect as it is reading it as \, and which is why doing
Ubuntu 14.04.5 LTS
If someone can please suggest as to how to solve this will be greatly appreciated. Thank you.