cancel
Showing results for 
Search instead for 
Did you mean: 

Re: How to set an environment variable on Fedora linux?

Former Member
0 Kudos

Hi Friends,

I want to set up environment variables like JAVA_HOME on fedora linux.

any help would be highly appreciated

Thanks,

Krishna

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Krishna,

Here are few tips to set the JAVA_HOME on Fedora Core.

Java Development Environment:

Download the Java 2 SDK 1.4.2.05 The self-extracting file has to be made executable before it can be run:

chmod +x j2sdk-1_4_2_05-linux-i586.bin

As root, copy it to /usr/local and run it:

su -

cp j2sdk-1_4_2_05-linux-i586.bin /usr/local

cd /usr/local

./j2sdk-1_4_2_05-linux-i586.bin

rm j2sdk-1_4_2_05-linux-i586.bin

Set up the environment by creating the file /etc/profile.d/java.sh with the following content:

JAVA_HOME=/usr/local/j2sdk1.4.2_05

JDK_HOME=$JAVA_HOME

PATH=$JAVA_HOME/bin:$PATH

CLASSPATH=.:/usr/local/j2sdk1.4.2_05/jre/lib/rt.jar

for i in /usr/share/java/*.jar ; do

CLASSPATH=$i:$CLASSPATH

done

export CLASSPATH PATH JDK_HOME JAVA_HOME

Make the java.sh script executable ("chmod +x /etc/profile.d/java.sh"). After logging out and back in, verify that everything is set up correctly:

java -version

echo $CLASSPATH

Hope this will helpful.

Regards

Kishore Chaganti

Former Member
0 Kudos

Hi Krishna,

At console give the following commands:[code]PATH="$PATH:/usr/java/j2sdk1.4.2_03/bin:."[/code][code]export PATH[/code]And also check this link:

http://www.dougsparling.com/comp/howto/linux_java.html

Regards,

Ville