Cannot build android apk

[16:26:33] webpack started …
[16:26:33] copy finished in 3.45 s
[16:26:39] webpack finished in 6.74 s
[16:26:39] sass started …
[16:26:40] sass finished in 913 ms
[16:26:40] postprocess started …
[16:26:40] postprocess finished in 7 ms
[16:26:40] lint started …
[16:26:40] build dev finished in 11.10 s

cordova build android

ERROR: JAVA_HOME is set to an invalid directory: /home/vinay/jdk1.8.0/

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

(node:25003) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /home/vinay/android-studio/gradle/gradle-4.1/bin/gradle: Command failed with exit code 1
[16:26:43] lint finished in 2.52 s


getting error as above please help

I guess you have to check your JAVA_HOME path