Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Linux Support (https://www.gnutellaforums.com/general-linux-support/)
-   -   Installing Java for a Newbie (https://www.gnutellaforums.com/general-linux-support/21740-installing-java-newbie.html)

mijl2222 September 8th, 2003 08:01 PM

Installing Java for a Newbie
 
As a newbie to linux I was haveing a hard time figureing out how to set the java home. non oth the other directions I tried seem to work for me.
I found these instruction when I was trying to install java for another app. it's fail proof.
First install java from rpm or bin dist.

To set up the global variable JAVA_HOME and add the binary directory to the path can be done by adding scripts to the /etc/profiles.d directory.

Using your favourite editor, create /etc/profiles.d/java.sh and /etc/profiles.d/java.csh. These are respectively:

#!/bin/sh
# JAVA additions
JAVA_HOME=/usr/java/j2sdk1.4.2
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME PATH
# End of .sh version

#!/bin/csh
# JAVA additions
if ( ! $?JAVA_HOME ) then
setenv JAVA_HOME /usr/java/j2sdk1.4.2
endif
if ( $?PATH ) then
setenv PATH $JAVA_HOME/bin:$PATH
else
setenv PATH $JAVA_HOME/bin
endif
# End of .csh version

Give the files the same ownership and permissions as other files in the directory.

Execute the .sh file just created to set up the correct environment for JAVA.

# source /etc/profile.d/java.sh

That's it for installing Java


All times are GMT -7. The time now is 01:40 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.