Let me try to clarify a little bit, since it seems like you're probably new to coding or at least new to Java.
Java has a "Java Runtime Environment", which is what the JRE is. This is the part of Java you need to execute java applications. It's fine for playing Minecraft. However, there is another part of Java that is used to create things that the JRE can run. This is the Java Development Kit, or JDK, and this is what is required when creating mods.
If you have not already installed the JDK, you can do so here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Once you have installed it, I believe it will update your JAVA_HOME environment variable for you. At this point, I would just try the command again. If it does not fix itself, you can update the JAVA_HOME environment variable yourself by going to Control Panel\All Control Panel Items\System, clicking on Advanced System Settings (it's a link over on the left side). This opens another window with a button near the bottom labeled Environment Variables.
Good luck!