Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
hi, so i intially removed all java packages b/c since i wanted eclipse to work, i needed suns sdk version. so i tried to follow the instructions on suns site ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2005
    Posts
    60

    installing java


    hi,
    so i intially removed all java packages b/c since i wanted eclipse to work, i needed suns sdk version.
    so i tried to follow the instructions on suns site and i got the following...
    " package jre-1.5.0_02-fcs is already installed" for JRE
    and
    "package jdk-1.5.0_02-fcs is already installed" for SDK

    but when i do something like
    java -version
    i get "bash: java: command not found"

    i am confused, if it's installed then why can't java -version get the right output?

    more importantly when i try to run eclipse, i get
    "A Java Runtime Environment (JRE) or Java Development Kit (JDK)
    must be available in order to run Eclipse. No Java virtual machine
    was found after searching the following locations:
    /home/armen/Desktop/eclipse/jre/bin/java
    'java' in your current PATH"

    can someone please help. i have been on this problem for a while now and i don't know who else to ask.

  2. #2
    Linux Enthusiast
    Join Date
    Dec 2004
    Location
    Rockin' in the USA!!!
    Posts
    603
    First off, how did you install java in the first place, and how did you remove it?

  3. #3
    Just Joined!
    Join Date
    Feb 2005
    Posts
    60
    here is how i removed it
    *********************************
    Removed all java related packages that pre-installed in Fedora Core 3
    1. java 1.4.2
    # rpm -qa | grep java
    the output of the above command:
    java-1.4.2-gcj-compat-devel-1.4.2.0-11jpp
    compat-gcc-java-8-3.3.4.2
    gcc-java-3.4.2-6.fc3
    java-1.4.2-gcj-compat-1.4.2.0-11jppa

    Removed the packages from FC3
    # rpm -e --nodeps java-1.4.2-gcj-compat-devel-1.4.2.0-11jpp
    # rpm -e --nodeps compat-gcc-java-8-3.3.4.2
    # rpm -e --nodeps gcc-java-3.4.2-6.fc3
    # rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-11jppa

    2. libgcj
    # rpm -qa | grep libgcj
    the output of the above command:
    compat-libgcj-8-3.3.4.2
    libgcj-devel-3.4.2-6.fc3
    libgcj-3.4.2-6.fc3
    compat-libgcj-devel-8-3.3.4.2

    Removed the packages from FC3
    # rpm -e --nodeps compat-libgcj-8-3.3.4.2
    # rpm -e --nodeps libgcj-devel-3.4.2-6.fc3
    # rpm -e --nodeps libgcj-3.4.2-6.fc3
    # rpm -e --nodeps compat-libgcj-devel-8-3.3.4.2

    3. jpackage-utils
    # rpm -qa | grep jpackage-utils
    the output of the above command:
    jpackage-utils-1.5.38-1jpp_3rh

    Removed the packages from FC3
    # rpm -e --nodeps jpackage-utils-1.5.38-1jpp_3rh
    *********************************

    i installed it using
    *********************************
    chmod a+x jdk-1_5_0_<version>-linux-i586-rpm.bin

    ./jdk-1_5_0_<version>-linux-i586-rpm.bin

    Note that the initial "./" is required if you do not have "." in your PATH environment variable.

    The script displays a binary license agreement, which you are asked to agree to before installation can proceed. Once you have agreed to the license, the install script creates the file jdk-1_5_0_<version>-linux-i586.rpm in the current directory.

    3. Become root by running the su command and entering the super-user password.

    4. Run the rpm command to install the packages that comprise the JDK:

    rpm -iv jdk-1_5_0_<version>-linux-i586.rpm
    *********************************
    and simliraliy or JRE. but it gave the "already installed" error on the last command.

  4. #4
    Linux Enthusiast
    Join Date
    Dec 2004
    Location
    Rockin' in the USA!!!
    Posts
    603
    do:
    Code:
    rpm -i --replacepkgs j2reblahwhateverthepackagenameis.rpm

  5. #5
    Just Joined!
    Join Date
    Feb 2005
    Posts
    60
    the way u suggested did finish thru. but unfortaunetly java -version doesn't work.
    neither is the JRE or JDK recognized?

    any other suggestions...i mean obviously it seems that i have the packages now, especially after what u suggested, could it be that the bash shell is not pointing to the right path?
    does anyone know how to put the right paths if my java installation directory is /usr/java/?

  6. #6
    Linux Enthusiast
    Join Date
    Dec 2004
    Location
    Rockin' in the USA!!!
    Posts
    603
    tell me what the command:
    Code:
    echo $PATH
    says

  7. #7
    Just Joined!
    Join Date
    Feb 2005
    Posts
    60
    /usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/armen/bin

  8. #8
    Linux Engineer
    Join Date
    May 2003
    Location
    Greece / Athens
    Posts
    1,169
    seems that you don't have the correct path set in PATH variable.to add the correct path that points to the java executable type:
    PATH=$PATH:/<path to java executable>
    Linux For Ever!

  9. #9
    Just Joined!
    Join Date
    Feb 2005
    Posts
    60
    if i am using bash, do u know where to place your suggestion?

  10. #10
    Linux Newbie
    Join Date
    Jul 2004
    Location
    Calcutta, India
    Posts
    220
    look in your home directory for a hidden file named .bash_profile , if it doesnt exist, create a new one and add the following line :

    export PATH=$PATH:/opt/jdk1.5.0/bin

    replace /opt/jdk1.5.0/bin with the appropriate path to the java bin directory on your system.

    N.B. : if u want to do this system-wide ( for all users ), u can follow the same procedure as mentioned above with /etc/profile .

Page 1 of 2 1 2 LastLast

Posting Permissions

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