My Windows 10 machine recently forcibly upgraded me to the new "Creators Update" version of windows, the "About your PC" widget now reports my OS version as "1703".
I thought I would have a crack at using the Windows Subsystem for Linux / Ubuntu on Windows to compile my Gradle projects.
I have a Windows JDK installed at c:\jvm\jdk1.8.0_102.
In my MinGW terminal window ("git bash"), I can setup a JAVA_HOME and execute the gradle wrapper script from my source directory and it will just work:
export JAVA_HOME=/c/jvm/jdk1.8.0_102
./gradlew tasks
But I can't figure out how to do an equivalent thing with WSL. Opening up the "Bash on Ubuntu on Windows" terminal, changing to my source directory and invoking the following:
export JAVA_HOME=/mnt/c/jvm/jdk1.8.0_102
./gradlew tasks
Results in the following:
ERROR: JAVA_HOME is set to an invalid directory: /mnt/c/jvm/jdk1.8.0_102
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Note that the Windows JDK runs fine from within the bash terminal. Executing $JAVA_HOME/bin/java.exe -version in the Ubuntu terminal will work fine.
The question is:
Is there any way to run my gradlew script from a "Bash on Ubuntu on Windows" terminal using the Windows JDK I've previously installed.
Please note:
I'm specifically asking if it's possible to get my Gradle script running using the Windows JDK, not an Ubuntu/Linux JDK installed with WSL. I understand I can likely run my gradle wrapper script by installing a Linux JDK within the Windows Sunbsystem for Linux, but I'm trying to figure out if it's possible to run my builds using the Windows JDK.