Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: installing java

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    installing java

    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
    "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:
    '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
    Rockin' in the USA!!!
    First off, how did you install java in the first place, and how did you remove it?

  3. #3
    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:

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

    2. libgcj
    # rpm -qa | grep libgcj
    the output of the above command:

    Removed the packages from FC3
    # rpm -e --nodeps compat-libgcj-8-
    # 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. jpackage-utils
    # rpm -qa | grep jpackage-utils
    the output of the above command:

    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


    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. $spacer_open
  5. #4
    Linux Enthusiast
    Join Date
    Dec 2004
    Rockin' in the USA!!!
    rpm -i --replacepkgs j2reblahwhateverthepackagenameis.rpm

  6. #5
    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/?

  7. #6
    Linux Enthusiast
    Join Date
    Dec 2004
    Rockin' in the USA!!!
    tell me what the command:
    echo $PATH

  8. #7

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

  10. #9
    if i am using bash, do u know where to place your suggestion?

  11. #10
    Linux Newbie
    Join Date
    Jul 2004
    Calcutta, India
    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 .

Posting Permissions

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