installing j2ee sdk directly from binary file is easier for novice users
in linux (and most Unix like systems) you can set environment variable like this:
export VARIABLE_NAME=VALUE
for example:
export JAVA_HOME=/user/arash_r/bin/java
you can check environment variable values using echo command
echo $VARIABLE_NAME
for example
echo $JAVA_HOME
path is path in most linux distributions and is case sensitive
in Debian linux for making variables persistence during reboots
you can define them in:
There is NO DEFAULT WAY of setting the variables in Debian, but you may use the /etc/environment file that can be parsed in scripts that use bourne compatible shells (like bash).
LANG=de_DE
LC_MESSAGES=en_US
Now, this file may be parsed by /etc/profile adding following line there:
. /etc/environment
the above is copyied from "Debian Maintenance HOWTO"
wish you best
and happy java experience over Linux
P.S.
can I know where are you using Java and Linux?