[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: how can export java?



On Wed, 2009-04-01 at 17:35 -0400, chloe K wrote:
> Hi 
>  
> I edit .bash_profile. but it can't work 
>  
> PATH=$PATH:$HOME/bin
> JAVA_HOME="/opt/SUN/jdk/bin" 
> export PATH JAVA_HOME
>  
> what wrong I am?
>  
> and why I use ln -s /usr/sbin/java /opt/SUN/jdk/bin/java
>  
> it won't work properly
>  
> Thank you
----
this is what I do...YMMV

# cat /etc/profile.d/java.sh
#
export JAVA_HOME=/usr/java/jdk1.6.0_03
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/jre/lib/i386: \
$JAVA_HOME/jre/lib/i386/client
export JREHOME="/usr/java/jdk1.6.0_03/jre"

obviously you have to adjust for your paths... the idea is that all
logins will execute shell scripts in /etc/profile.d

and I would expect that you have your symbolic link wrong...

ln -s /opt/SUN/jdk/bin/java /usr/bin/java
      --------------------- -------------
          source for link     target for link

which will work if /usr/bin/java (target) doesn't already exist

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]