You are not logged in.
Pages: 1
Is there any such thing as environment variables in Linux? I have Java's JDK and JRE downloaded and installed in folders... Now I need my environment variables to point to them.
Offline
Type
env
to see all environment variables. In bash, you can set new ones with
export VARIABLE=value
.
Hope that helps...
Last edited by mmmasterluke (2008-06-16 22:03:12)
Offline
If you want to define the classpath:
export CLASSPATH=.:/path/to/your/classes:/another/path
unlike windows, path separators are colons, not semicolons
Only deaths can see the end of battles.
Blog: http://djmartinez.co.cc -> The life of a Computer Engineer
Offline
It's usually better to add things to CLASSPATH or PATH, instead of overwriting them, as this may cause other applications to break.
For example:
export CLASSPATH=$CLASSPATH:/your/new/path/here
tea is overrated
Offline
you can set these variables in your ~/.bashrc (or ~/.${shell}rc, if you're fancy) to have them be defined whenever you fire up a terminal, in particular on boot.
Offline
System wide changes can be done in /etc/profile.
Offline
If I add
export PATH='$PATH:~/jre1.6.0_06/bin'
to my file '~/.bashrc' would that work?
Last edited by da-man9191 (2008-06-17 20:14:58)
Offline
yes, but only for your account.
You could also place a script or soft link pointing to them in /usr/bin, /usr/local/bin or anywhere else that PATH is already pointing to. This would keep things much simpler, in my opinion.
Offline
If I add
export PATH='$PATH:~/jre1.6.0_06/bin'
to my file '~/.bashrc' would that work?
If you replace the single quotes with double quotes, then yes.
-- Thomas Adam
Offline
Pages: 1