Android AR JAVA_HOME Error

As I was trying to launch an AR game to my Android device I get the following errors:

ERROR: JAVA_HOME is set to an invalid directory: D:\AndroidStudio\jre

ERROR: cmd.exe failed with args /c “C:\Users\bruno\OneDrive\Documents\Unreal Projects\ARTestWithOcean 4.25 - 2 4.25 - 2 4.25\Intermediate\Android\armv7\gradle\rungradle.bat” :app:assembleDebug

Error: Launch failed! Unknown Error

It surprises me that UE is trying to access JAVA_HOME from a D: drive, even though I don’t even have a D: drive on my computer at the moment. The project was launching just fine the previous day, the only thing I change was the units from cm to ft (don’t think that would affect this error, though).

Really great post admin thanks for sharing this.