Find the answer to your Linux question:
Results 1 to 2 of 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    6

    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
    fi

    # User specific environment and startup programs

    PATH=$PATH:/home/mec/jdk1.5.0/bin/java:/home/mec/apache-ant-1.6.2/bin
    JAVA_HOME=/home/mec/jdk1.5.0
    export JAVA_HOME

    complete -C complete-ant-cmd ant build.sh
    export PATH
    unset USERNAME




    .bashrc contents :
    # .bashrc

    # Source global definitions


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

    # 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
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,558
    Your likely problem is here
    PATH=$PATH:/home/mec/jdk1.5.0/bin/java:/home/mec/apache-ant-1.6.2/bin
    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:
    Code:
    PATH=/home/mec/jdk1.5.0/bin:/home/mec/apache-ant-1.6.2/bin:${PATH}
    JAVA_HOME=/home/mec/jdk1.5.0
    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
  •