In many recent situations, but right now I tried using a installer, that throws an error and says something along the lines of \"Java not installed\" even though the JAVA_HOME i
Your actual question is unclear, but this looks like an X-Y problem. Your real problem is that you had problems installing NetBeans 8.2 (right?), but you are incorrectly jumping to the conclusion that the cause was somehow related to your setting of JAVA_HOME. It isn't.
First, from the NetBeans 8.2 download page, note that "JDK 8 is required for installing and running the Java SE, Java EE and All NetBeans Bundles. NetBeans 8.2 does not run on JDK 9 or later". So at least part of your problem is that you were trying to use JDK 13 with NetBeans 8.2. That just won't work.
Second, you don't need to set the environment variable JAVA_HOME for NetBeans 8.2 to work. I just deliberately sabotaged my setting of JAVA_HOME, and NetBeans 8.2 restarts and works just fine. This is a good thing, because you may legitimately want to set JAVA_HOME to some arbitrary JDK for some other reason completely unrelated to NetBeans, and doing so might break NetBeans 8.2 if it relied on JAVA_HOME.
Third, NetBeans does not care about your PATH setting either. (As an aside, NetBeans ignoring JDK_HOME and PATH means that you can install different versions of NetBeans each of which uses a different JDK, and safely run them concurrently.)
To explicitly specify the JDK that your NetBeans 8.2 installation should use:
netbeans_jdkhome
.#
(denoting a commented line) remove that, then set netbeans_jdkhome
to specify the path to your JDK 8 installation. On my Windows 10 machine that line looks like this: netbeans_jdkhome="C:\Java\jdk1.8.0_221"
.netbeans_jdkhome
(which will be to your JDK 8 installation directory), then save your changes to netbeans.conf and (re)start NetBeans 8.2. Hopefully that is all you need to do to resolve your issue, but if not please update your question to clarify the precise problem that needs to be solved.