Ionic Android Platform Build Failed


Everytime i try to build my android platform on ionic I am greeted by the error stating that my JAVA_HOME is invalid whereas it points to the correct path as seen below. I have tried removing and re-adding the platform and re-adding the paths in the environment variables but nothing seems to work. I have been trying to troubleshoot this error for days now. Please help!