首先,我们来看看yum库是否有java安装包
[code="linux"]
yum -y list java*
[/code]
然后我们安装java1.6.x,怎样使用yum安装java? 怎么用yum安装jdk?
[code="linux"]
yum -y install java-1.6.0-openjdk*
[/code]
查看yum安装java的结果,安装完成后,执行java -version
[code="linux"]
java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (rhel-1.23.1.9.10.el5_7-i386)
OpenJDK Client VM (build 19.0-b09, mixed mode)
[/code]
执行java的时候,遇到错误:
Could not reserve enough space for object heap
Could not create the Java virtual machine.
解决办法:
在ssh下用root执行
还有错误的话,请参考
http://forums.vpslink.com/linux/1327-java-could-not-reserve-enough-space-object-heap.html
http://forum.openvz.org/index.php?t=msg&goto=7061
[code="linux"]
yum -y list java*
[/code]
然后我们安装java1.6.x,怎样使用yum安装java? 怎么用yum安装jdk?
[code="linux"]
yum -y install java-1.6.0-openjdk*
[/code]
查看yum安装java的结果,安装完成后,执行java -version
[code="linux"]
java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (rhel-1.23.1.9.10.el5_7-i386)
OpenJDK Client VM (build 19.0-b09, mixed mode)
[/code]
执行java的时候,遇到错误:
Could not reserve enough space for object heap
Could not create the Java virtual machine.
解决办法:
在ssh下用root执行
export _JAVA_OPTIONS="-Xms32m -Xmx64m -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:NewSize=10m -XX:MaxNewSize=10m -XX:SurvivorRatio=6 -XX:TargetSurvivorRatio=80 -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
还有错误的话,请参考
http://forums.vpslink.com/linux/1327-java-could-not-reserve-enough-space-object-heap.html
http://forum.openvz.org/index.php?t=msg&goto=7061