Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    problem in installing JDK1.5.0

    try to be more clear, i'm in lack of ideas in this problem.
    I downloaded jdk-1_5_0-linux-i586.bin and and execute the script
    and install it at path : /home/mec/jdk1.5.0
    and change my .bash_profile

    My bash_profile contents :-

    # .bash_profile

    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc

    # User specific environment and startup programs

    export JAVA_HOME

    complete -C complete-ant-cmd ant
    export PATH
    unset USERNAME

    .bashrc contents :
    # .bashrc

    # Source global definitions

    if [ -f /etc/bashrc ]; then
    . /etc/bashrc

    # User specific aliases and functions

    when i type command echo $JAVA_HOME it gives :/home/rishabh/jdk1.5.0

    But "type java" output is:
    java is aliased to`/home/mec/j2sdk1.4.2_19/bin/java'

    and "java -version" output is :
    java version "1.4.2_19"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)
    Java HotSpot(TM) Client VM (build 1.4.2_19-b04, mixed mode)

    (Note intially j2sdk1.4.2_19 was installed which i changed jdk1.5.0)

    I have spend hours trying to play around with this but have got nowhere.

    i want jdk1.5.0 on my system.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Your likely problem is here
    You have several errors here.
    1. You don't export PATH
    2. You append the new java path instead of prepending it to the old PATH
    3. You need to use ${PATH} in the new string when changing PATH itself, instead of $PATH.
    4. You set your java path to /home/mec/jdk1.5.0/bin/java, a file name, instead of /home/mec/jdk1.5.0/bin, the directory for java.

    Your PATH setting should therefor be as follows:
    export JAVA_HOME PATH
    There are some other issues as well that will allow you to better use multiple java versions in your system without so many problems, but I won't get into them here. This should get you operational.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts