I've installed JDK1.5. I try to set classpath use "export", but it only work on the current console. When I restart or open another console, the JDK path can't be found. I used to install JDK on RedHat Linux, there is a file /etc/profile. I can insert my Java Path here. But in Debian, the profile looks like this:
One way to do this is to add a line at the end of /etc/profile to add more paths to the PATH variable. However, this is undesirable because it changes the PATH for every user. If you only have a single user on your machine, then it probably isn't too bad. A more elegant solution is to modify your user's .profile instead. Another option is to modify the rc script for the shell you use. For example, if you use bash, then you can modify .bashrc in your user's home directory to set the PATH the way you want it.
I hope this makes sense. If not, let me know and I will provide more details.
It still can't work. Now my .bashrc looks like this:
The result is "louis@debian:~$ java bash: java: command not found "
Joined: Jan 28, 2005
It works when I set the Path like this!
I think the "$" here is very important.
Joined: Dec 06, 2001
In a bash script $ means to use the value of a variable. Without the $, the name is not evaluated. In other words, the name just stands for the literal characters. This means that on the left of the = sign, you typically want the variable name without the $, but on the right, you need the $ to get a variable's value rather than the exact characters you typed.
Also, the word "export" is important for the variable's value to last beyond the script's execution. Without the "export", the variable is "local" to the script, so to speak.