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
...
- 11-11-2011 #1
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
but when I type java -v command or java --version command it gives ' could not create java virtual machine' message# .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
could I know hot to configure it properly
- 11-11-2011 #2
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/
- 11-11-2011 #3Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
What about this?
note the lack of two hyphens.Code:java -version
- 11-17-2011 #4
- 11-19-2011 #5Just 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
- 11-21-2011 #6
- 11-21-2011 #7Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
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.:
you don't need to mark the scripts in /etc/profile.d as executable - they get sourced, not executed.Code:export PATH="${PATH}:${JAVA_HOME}/bin"


Reply With Quote
