and it's possible to execute all programs from $JAVA_HOME/bin directory from console (including jar program).

Now, what I noticed is that some time ago I installed java, javac and javaws specifically using sudo update-alternatives --install ... command into /usr/lib/bin folder.

So I tried to install jar in the same way (using sudo update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_35/bin/jar" 1) and the initial problem was solved - above error didn't appear when I tried to install Glassfish again. But another problem appeared - it looks like during installation GF installer couldn't find keytool program this time.

I'm not very happy with installing several dozens of programs from Java bin folder, so the main question is: is there significant difference from the point of view of other programs (like Glassfish installer) between:

installing some program using sudo update-alternatives --install /usr/bin/program-name program-name /path/to/program-name 1
and

This question appears to be off-topic. The users who voted to close gave this specific reason:

"This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – Seth