Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
i'm a newbie in linux .... i downlaoded the j2sdk-1_4_2_12-linux-i586-rpm.bin.bin . i installed it usin the following commands #sh j2sdk-1_4_2_12-linux-i586-rpm.bin.bin #rpm -iv j2sdk-1_4_2_12-linux-i586-rpm i got the installation was successful.but whe ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Nov 2005
    Posts
    176

    problerm with java


    i'm a newbie in linux ....

    i downlaoded the j2sdk-1_4_2_12-linux-i586-rpm.bin.bin . i installed it usin the following commands

    #sh j2sdk-1_4_2_12-linux-i586-rpm.bin.bin
    #rpm -iv j2sdk-1_4_2_12-linux-i586-rpm

    i got the installation was successful.but whe i run the command javac n java i get

    bash: java: command not found

    even i tried in /usr/java/j2sdk-1_4_2_12/bin commands javac n java

    i couldnt recover the error...
    plz help me.......!!!!!!!!!

  2. #2
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by harishbayyavarapu
    bash: java: command not found

    even i tried in /usr/java/j2sdk-1_4_2_12/bin commands javac n java

    i couldnt recover the error...
    plz help me.......!!!!!!!!!
    So you're saying the /usr/java/j2sdk-1_4_2_12/bin/java command exists, but it gives you an error when you run it? What is the error?
    Registered Linux user #270181
    TechieMoe's Tech Rants

  3. #3
    Linux User twoHats's Avatar
    Join Date
    Jan 2005
    Location
    NH, USA
    Posts
    280

    Java

    Hi ... Java needs exactly one thing to run - a path.

    There may be other complications (permissions etc) causing a problem.

    Look in /usr/java/j2sdk-1_4_2_12/bin and make sure that:
    a. java is there, and
    b. users have permission to execute it.

    Then try (from the command line) echo $PATH - maker sure /usr/java/j2sdk-1_4_2_12/bin is in the path.

    Let us know ...
    - Clouds don't crash - Bertrand Meyer

    registered Linux user 393557

    finally - hw to brag about - but next year it will look pitifully quaint:
    Athlon64 X2 3800 - 1G PC3200 - 250G SATA - ati radeon x300
    circa 2006

  4. #4
    Linux Newbie
    Join Date
    Nov 2005
    Posts
    176
    So you're saying the /usr/java/j2sdk-1_4_2_12/bin/java command exists, but it gives you an error when you run it? What is the error?

    the same error.......

    bash: java: command not found

    ya i tried echo $PATH i dont have the given path..... i have
    /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
    so how could i chage my path
    plz help me......i'm damm fed up !!!!!!!

  5. #5
    Just Joined! letmeknowlinux's Avatar
    Join Date
    Mar 2006
    Posts
    82
    For setting the path variable the syntax is:

    PATH= $PATH:/usr/java/j2sdk-1_4_2_12/bin
    export PATH

    Place this in .profile or .bashrc file in your home directory so that you don't need to do this everytime you login.

  6. #6
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Whenever you install java, you need to put it in your path. For Redhat based distros, derivatives and forks (like Mandriva), you can put java in everyones path by simpling placing a bash script in /etc/profile.d, naming it something like java.sh and making it executable. An example of the script I use for Mandriva 2006 and Suse 10.1 is below,
    Code:
    #!/bin/sh
    export JAVA_HOME=/opt/java
    export MANPATH=$MANPATH:/opt/java/man
    export PATH=$PATH:/opt/java/bin:/opt/java/jre/bin
    In the script above, java is install in /opt/java, so when modifying the script, make sure the paths match those on your system.

  7. #7
    Just Joined!
    Join Date
    Jul 2006
    Posts
    1

    Thumbs up java bin path needs to be set to $PATH Variable

    # rpm -ivh j2sdk-1_4_2_12-linux-i586-rpm
    # cd /usr/local
    # ln -s /usr/java/j2sdk1.4.2_12 java
    # cd /usr/bin
    # ln -s /usr/local/java/bin java

    Edit or replace the .bash_profile for root user

    PATH=$PATH:/usr/bin/java
    export PATH

    JAVA_HOME=/usr/local/java


    resource profile
    # . ./.bash_profile

  8. #8
    Just Joined!
    Join Date
    Aug 2006
    Posts
    6
    Quote Originally Posted by vijaysam79
    # rpm -ivh j2sdk-1_4_2_12-linux-i586-rpm
    # cd /usr/local
    # ln -s /usr/java/j2sdk1.4.2_12 java
    # cd /usr/bin
    # ln -s /usr/local/java/bin java

    Edit or replace the .bash_profile for root user

    PATH=$PATH:/usr/bin/java
    export PATH

    JAVA_HOME=/usr/local/java


    resource profile
    # . ./.bash_profile
    your code is confusing.

    # ln -s /usr/local/java/bin java
    ln -s /usr/java/j2sdk1.4.2_12 java

    i never heard "java bin"
    the directory name is weird.
    but thanks for providing info and helping

  9. #9
    Just Joined!
    Join Date
    Aug 2006
    Posts
    6
    Quote Originally Posted by letmeknowlinux
    For setting the path variable the syntax is:

    PATH= $PATH:/usr/java/j2sdk-1_4_2_12/bin
    export PATH

    Place this in .profile or .bashrc file in your home directory so that you don't need to do this everytime you login.
    this code is so simple, much easier to understand.

  10. #10
    Just Joined!
    Join Date
    Apr 2011
    Posts
    1
    Quote Originally Posted by letmeknowlinux View Post
    For setting the path variable the syntax is:

    PATH= $PATH:/usr/java/j2sdk-1_4_2_12/bin
    export PATH

    Place this in .profile or .bashrc file in your home directory so that you don't need to do this everytime you login.
    How do we place "this" in .profile or .bashrc?

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
  •