Linux: Setting JAVA_HOME for a single user and all users

Here is how to setup JAVA_HOME and PATH environment variables for a single user or all users on Fedora Linux system

Setting JAVA_HOME and PATH for a single user

# vi ~/.bash_profile
# export JAVA_HOME=/opt/jdkx.x.x_xx
# export PATH=$PATH:$JAVA_HOME/bin

Setting JAVA_HOME and PATH for all users

# vi /etc/profile
# export JAVA_HOME=/opt/jdkx.x.x_xx
# export PATH=$PATH:$JAVA_HOME/bin
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s