I just solved this very problem for me. I do not know why you will not have the JDK_HOME variable. Remove JDK completely and install it again, maybe? Environment Variables for java were installed on my previously installed path. I assume that Oracle is screwed here.
Since I had the same error, here is what I did:
I went to C:\Program Files\Java\ and checked how the jdk folder is called. For me, this is jdk1.8.0_102 .
For users who do not know where to find System Variables : Go to System Properties and click Advanced System Settings on the left. Go to the Advanced tab, click Environment Variables . In the System Variables section of the list, there must be two variables JAVA_HOME and JDK_HOME .
I edited these values ββand changed the path to what I found in the java folder. In my case, it will be C:\Program Files\Java\jdk1.8.0_102 .
No need to close VS, just create an application and it should go through an annoying error.
Hope this helps :)
DerpyNerd
source share