> java, not j2ee.
----- Original Message -----
From: Scott Taylor
To: Java 2 Enterprise Edition
Sent: Tuesday, October 08, 2002 12:02 PM
Subject: [j2ee] RE: Environment Variable (Linux bash shell)
I understand that it should be /.bash_profile but this does not seem to work
when I add the java reference. Here is that file:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/lib:$HOME/j2sdkee1.3.1/bin:/usr/local/apache2/bin:/root/pointbase/tools/server
BASH_ENV=$HOME/.bashrc
USERNAME="root"
J2EE_HOME=$HOME/j2sdkee1.3.1
export USERNAME BASH_ENV PATH J2EE_HOME
I get the following when I type j2ee -version:
[root@l... root]# j2ee -version
/root/j2sdkee1.3.1/bin/j2ee:/java/re/jdk/1.3.1_02/latest/binaries/linux-i386/bin/java:
No such file or directory
Any ideas?
Regards
Scott
------------------------------------------------------------------------
Hello Scott
i know your problem, i have had the same! I am running RedHat 8.0
and i wanted to compile my java programs right ahead with "javac"
without specifying the PATH each time i logged on my session as a
user, even though i am the root too.
Let me explain to you quickly what you need to do in order to have
your .bash_profile configured in a manner that you won't have to worry
about javac anymore, because each time you will log on, you should be
able to compile right away.
(here is how .bash_profile looks like at default)
-------------------------------------------------
.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/bashrc
fi
#user specific environment and startup programs
PATH=$PATH:/$HOME/bin
export PATH
unset USERNAME
-------------------------------------------------
*(scott, do not change this PATH to the $HOME/bin,
because otherwise, you won't be able to log in as
a user. Because the Home/Bin contains everything
about you destop environment). *******
in my case, because i am using jsdk1.2.2, and because
i installed it in /usr/local/jdk1.2.2/bin
then, what i did is put a path to that directory, save
.bash_profile and reboot the system. and it works fine.
Tough, i spend 4 hour just to do that because i tried
dozens of syntaxes and locations, .bashrc, bashrc, profile,
etc...
Anyway, go to your Home/Scott/ and emacs .bash_profile
then replace the export PATH by
export PATH=/usr/local/jsdk1.3.1/bin
and save your bash_profile.
your .bash_profile should look like this:
---------------------------------------------------------
.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/bashrc
fi
#user specific environment and startup programs
PATH=$PATH:/$HOME/bin
export PATH=/usr/local/jsdk1.3.1/bin/:$PATH
unset USERNAME
---------------------------------------------------------
Scott, i recommend you to move your jsdk1.3.1 directory
from your $Home/Scott directory to the /usr/local directory.
The reason to that is that once the configurations are set,
any user on your system will be able to compile java programs.
like for example your .bash_profile, you should delete some
lines:
--------------------------------------------------------
PATH=$PATH:$HOME/bin:/usr/lib:/usr/local/apache2/bin:/root/pointbase/tools/server
export PATH=/usr/j2sdk1.3.1/bin/:$PATH
unset USERNAME
---------------------------------------------------------
and don't forget to save the changes and reboot your system,
so that the changes take effect. don't worry about the source
command.
best regards!
Freddy