Whether or not an alias is enough will depend a lot on the program in question and how you use it. If you are the only user on your machine using the program, and you always call it from an interactive console, and never use it inside scripts, then an alias might be sufficient (unless you notice things not working right).
But if you want to use the command in scripts, or even put launchers to it (in the GNOME menu or gnome-panel or in a dock, etc.), then it'll be more convenient to do something else.
Your other options are to 1) define a symbolic link, from, e.g., /usr/local/bin
cd /usr/local/bin
sudo ln -s /usr/java/jdk1.6.0_21/bin/javac javac
Then, javac helloworld.java
should work.
Or 2), modify your $PATH environmental variable to include the directory in question, e.g., in your .bashrc or .profile, etc., put:
export PATH=$PATH:/usr/java/jdk1.6.0_21/bin
And then all the executables in that folder can be called directly.