你的位置:国外/美国服务器租用 技术文档 LinuxVPS使用教程 正文
美国服务器出租
  1. 1美国独立服务器10G独享带宽不限流量,欧洲1G带宽独享,不限流量
  2. 2美国100M独享,洛杉矶 32GB内存 英特尔至强CPU,特价:1699元/月
  3. 3美国加州机房100M独享E3-1270,32G内存/96G内存,送KVM,1399元/月
  4. 4美国云服务器,8G内存,服务器CPU,4核心,特价699元/月,16G内存1299元
  5. 5美国G口抗攻击服务器,G口1000M独享带宽抗DDOS攻击服务器(至强Xeon E3 1230)
  6. 6国外G口带宽独享服务器,美国G口独享,欧洲G口独享服务器租用
  7. 7美国圣安娜KT服务器,加州KT服务器租用,KT独立服务器出租(特价799元/月)
  8. 8加州洛杉矶机房,中国访问速度最快的美国机房之一,999元/月,4G内存20M独享
  9. 9美国1G独享带宽,欧洲1G独享带宽租用(视频等大流量网站解决方案)
  10. 10凤凰城机房Phoenix服务器租用:7个机房4核I3,8G内存,30M独享带宽,首月999元
美国VPS主机
  1. 1美国SSD VPS租用,美国西海岸加州洛杉矶SSD VPS服务器,Linux/Windows
  2. 2内华达州VPS,拉斯维加斯VPS,拉斯维加斯服务器,内华达州服务器租用
  3. 3美国东海岸VPS,纽约服务器,曼哈顿云服务器,纽约VPS租用
  4. 4外贸VPS服务器,仿牌空间,仿牌主机,抗投诉VPS(外贸英文商城VPS)SSL证书安装服务
  5. 5美国Psychz电信直连VPS,中国访问速度最快的美国VPS,Psychz机房VPS
  6. 6Camforg专用VPS,美国Camforg多视频聊天软件VPS,Camforg服务器租用
  7. 7美国加州VPS,洛杉矶WebNX机房VPS,加州WN机房Windows VPS
  8. 8美国西雅图VPS,西雅图机房VPS,支持试用的VPS,VPS试用10元/天
  9. 9合租美国服务器,国外服务器合租,高端VPS服务器,完胜低配独立服务器的VPS
  10. 10抗攻击Windows VPS,不怕DDOS攻击的VPS,有攻击不关机,无攻击后2小时内恢复
Linux/centos的VPS上如何YUM安装Java和JDK环境?怎么用yum安装jdk?
  • 有些客户需要在VPS安装java/jdk6,但是一个一个下载和编译安装十分话时间,那么,Linux/centos如何YUM安装Java和JDK环境?

    首先,我们来看看yum库是否有java安装包

    [root@233797 www.ctohome.com]yum -y list java*
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.grikare.com
     * extras: centos.mirror.facebook.net
     * rpmforge: ftp-stud.fht-esslingen.de
     * updates: mirror.grikare.com
    Excluding Packages in global exclude list
    Finished
    Available Packages
    java-1.4.2-gcj-compat.i386                                                              1.4.2.0-40jpp.115                                                                base  
    java-1.4.2-gcj-compat-devel.i386                                                        1.4.2.0-40jpp.115                                                                base  
    java-1.4.2-gcj-compat-javadoc.i386                                                      1.4.2.0-40jpp.115                                                                base  
    java-1.4.2-gcj-compat-src.i386                                                          1.4.2.0-40jpp.115                                                                base  
    java-1.6.0-openjdk.i386                                                                 1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
    java-1.6.0-openjdk-demo.i386                                                            1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
    java-1.6.0-openjdk-devel.i386                                                           1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
    java-1.6.0-openjdk-javadoc.i386                                                         1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
    java-1.6.0-openjdk-src.i386                                                             1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
    java_cup.i386                                                                           1:0.10-0.k.6jpp.1                                                                base  
    java_cup-javadoc.i386                                                                   1:0.10-0.k.6jpp.1                                                                base  
    java_cup-manual.i386                                                                    1:0.10-0.k.6jpp.1                                                                base  
    javacc.i386                                                                             4.0-3jpp.3                                                                       base  
    javacc-demo.i386                                                                        4.0-3jpp.3                                                                       base  
    javacc-manual.i386                                                                      4.0-3jpp.3     

     

    然后我们安装java1.6.x,怎样使用yum安装java? 怎么用yum安装jdk?

    [root@233797 www.ctohome.com]yum -y install  java-1.6.0-openjdk*

     

    查看yum安装java的结果,安装完成后,执行java -version

    [root@233797 www.ctohome.com]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)

     

     执行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

     

     

  • 点这里复制本页地址发送给您QQ/MSN上的好友