It works fine in Terminal and for for my apps but when I launch any app for mac written in Java I get typical "To open X you need to install Java SE 6 runtime. Would you like to install one now?" message.

Is there a way to tell OS X to launch Java apps with java I installed without installing another one? I'm trying to run IntelliJ IDEA 12.