It is because the Java version used by the Minecraft app is not in the applications folder, but in the following path: /Users/username/Application Support/minecraft/runtime/jre-x64/jre.bundle/contents/home/bin/java
note:
replace "username" with your username, "jre-x64" is for a 64 bit computer (I think), "contents" might not be in the actual path (I went through finder to get to it).
or you can just right click on its icon (if its in your dock) and select "show in finder".
If you can make an alias in the applications folder for Java, you could try to limit that instead (I think it would redirect the limit to Java itself).
Edit: Since Java is a Unix executable, I'm not sure if it will work