Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, I tried installing JRE (jre-6u22-linux-i586.bin) in CentOS 5.7 i386. Did the following steps for that 1. Download the Linux Generic (jre-6u22-linux-i586.bin) binary file (Oracle site). 2. chmod +x jre-6u22-linux-i586.bin ...
  1. #1
    Just Joined! amithad's Avatar
    Join Date
    Sep 2006
    Posts
    64

    Question JRE installation and configuration

    Hi,

    I tried installing JRE (jre-6u22-linux-i586.bin) in CentOS 5.7 i386. Did the following steps for that

    1. Download the Linux Generic (jre-6u22-linux-i586.bin) binary file (Oracle site).
    2. chmod +x jre-6u22-linux-i586.bin
    3. ./jre-6u22-linux-i586.bin
    4. to set the JAVA_HOME edited the bash_profile of the user by using the command vi ~/.bash_profile
    5. exporting JAVA_HOME by typing
    # .bash_profile

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

    # User specific environment and startup programs

    PATH=$PATH:$HOME/bin

    export PATH

    export JAVA_HOME=/usr/java/jre1.6.0_22/bin/java
    export PATH=$PATH:/usr/java/jre1.6.0_22/bin
    but when I type java -v command or java --version command it gives ' could not create java virtual machine' message

    could I know hot to configure it properly

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,393
    Take a look at the 'alternatives' command, read down its man page. It's designed for configuring the java system used by your computer.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    What about this?

    Code:
    java -version
    note the lack of two hyphens.

  4. #4
    Just Joined! amithad's Avatar
    Join Date
    Sep 2006
    Posts
    64
    Hi,

    Thanks for the information


  5. #5
    Just Joined!
    Join Date
    Nov 2011
    Location
    Bandung
    Posts
    6
    You can try this
    /usr/sbin/alternatives --config java (to show your program java default)

    then
    # cd/etc/profile.d/
    #touch java.sh
    # vi java.sh

    export JAVA_HOME="/usr/java/your_java_version"
    export PATH="$PATH:$JAVA_HOME/bin"

    chmod +x /etc/profile.d/java.sh

    Last reboot your linux

  6. #6
    Just Joined! amithad's Avatar
    Join Date
    Sep 2006
    Posts
    64

    Thumbs up

    Quote Originally Posted by arzachel View Post
    You can try this
    /usr/sbin/alternatives --config java (to show your program java default)

    then
    # cd/etc/profile.d/
    #touch java.sh
    # vi java.sh

    export JAVA_HOME="/usr/java/your_java_version"
    export PATH="$PATH:$JAVA_HOME/bin"

    chmod +x /etc/profile.d/java.sh

    Last reboot your linux
    Dear Arzachel,

    That's pretty cool. I'll try that definitely

    Thanks

  7. #7
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    Quote Originally Posted by arzachel View Post
    You can try this
    /usr/sbin/alternatives --config java (to show your program java default)

    then
    # cd/etc/profile.d/
    #touch java.sh
    # vi java.sh

    export JAVA_HOME="/usr/java/your_java_version"
    export PATH="$PATH:$JAVA_HOME/bin"

    chmod +x /etc/profile.d/java.sh

    Last reboot your linux
    Yes, this is handy, I do it too - but just a couple notes:

    you should use curly braces when expanding variables when they butt up against other characters, e.g.:

    Code:
    export PATH="${PATH}:${JAVA_HOME}/bin"
    you don't need to mark the scripts in /etc/profile.d as executable - they get sourced, not executed.

Posting Permissions

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