zoukankan      html  css  js  c++  java
  • CentOS7 jdk安装

    上传jdk-8u231-linux-x64.tar.gz到/opt目录
    cd /opt
    tar -xvf jdk-8u231-linux-x64.tar.gz -C /opt
    
    cat >> /etc/profile <<"EOF"
    AVA_HOME=/opt/jdk1.8.0_231
    CLASSPATH=.:$JAVA_HOME/lib.tools.jar
    PATH=$JAVA_HOME/bin:$PATH
    export JAVA_HOME CLASSPATH PATH
    EOF
    
    在/etc/init.d/functionsPATH后面追加JDK路径,如:
    sed -i 's$PATH="/sbin:/usr/sbin:/bin:/usr/bin"$PATH="/sbin:/usr/sbin:/bin:/usr/bin:/opt/jdk1.8.0_231/bin"$g'
    
    source /etc/profile
    java -version
    
    
    
    ---
    配置JCE加密算法强度不受限授权
    cd ~/
    mkdir tmp
    cd tmp
    wget -v --header "Cookie: oraclelicense=accept-securebackup-cookie" https://edelivery.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip -O jce_policy-8.zip
    unzip jce_policy-8.zip
    cd UnlimitedJCEPolicyJDK8/
    mkdir original
    mv /opt/jdk1.8.0_231/jre/lib/security/local_policy.jar original
    mv /opt/jdk1.8.0_231/jre/lib/security/US_export_policy.jar original
    cp local_policy.jar US_export_policy.jar /opt/jdk1.8.0_231/jre/lib/security/
    ls -lrt /opt/jdk1.8.0_231/jre/lib/security/
    最终确认local_policy.jar、US_export_policy.jar替换成功
    
    rm -rf ~/tmp
    
    
    ---
    在某些操作系统如CentOS 7,JDK第一次生成随机数会非常慢,参考:
    https://docs.oracle.com/cd/E13209_01/wlcp/wlss30/configwlss/jvmrand.html
    我们需要将修改$JAVA_HOME/jre/lib/security/java.security文件
    
    sed -i 's$securerandom.source=file:/dev/random$securerandom.source=file:/dev/urandom$g' $JAVA_HOME/jre/lib/security/java.security
    

      

  • 相关阅读:
    关于游戏分布式或者多服管理的想法
    surfaceView
    ackerman递归
    netbeans环境的建立
    copy-浅及深的复制操作
    使用VMware安装CentOS6.8详细教程
    Python在线资源优先级排序
    Python导入模块,Python import用法
    编码
    Python清屏命令
  • 原文地址:https://www.cnblogs.com/xiaochangwei/p/jdk.html
Copyright © 2011-2022 走看看