CentOS 7 installation jdk8

  1. Search can be installed jdk

    yum -search java-1.8
  2. Select the version installed

    yum -y install java-1.8.0-openjdk-devel.x86_64
  3. Get jdk installation directory

    /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64
  4. Increase the allocation at the bottom

    export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64
    export PATH=$JAVA_HOME/bin:$PATH
    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    
    解释: 
    - 只需要改第一行“export JAVA_HOME=”后的部分为你的JDK路径,注意末尾不要加“/”。其他都无需更改。 
    - exprot命令用于将shell变量输出为环境变量 
    - “:”冒号,linux中用于分割路径,Windows中用“;” 分割。,在此分割JAVA_HOME和其他环境变量($PATH) 
    - CLASSPATH中的 “.” 不能丢失。CLASSPATH指引到tools.jar,才可以在任意目录下用“javac”命令
    --------------------- 
    作者:大脑补丁 
    来源:CSDN 
    原文:https://blog.csdn.net/x541211190/article/details/74786393 
    版权声明:本文为博主原创文章,转载请附上博文链接!
  5. The environment variables to take effect immediately

    source /etc/profile
  6. Check the environment variable configuration is successful, the following information on the configuration was successful

    [root@bogon /]# javac
    
    Usage: javac <options> <source files>
    where possible options include:
      -g                         Generate all debugging info
      -g:none                    Generate no debugging info
      -g:{lines,vars,source}     Generate only some debugging info
      -nowarn                    Generate no warnings
      -verbose                   Output messages about what the compiler is doing
      -deprecation               Output source locations where deprecated APIs are used
      -classpath <path>          Specify where to find user class files and annotation processors
      -cp <path>                 Specify where to find user class files and annotation processors
      -sourcepath <path>         Specify where to find input source files
      -bootclasspath <path>      Override location of bootstrap class files
      -extdirs <dirs>            Override location of installed extensions
      -endorseddirs <dirs>       Override location of endorsed standards path
      -proc:{none,only}          Control whether annotation processing and/or compilation is done.
      -processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process
      -processorpath <path>      Specify where to find annotation processors
      -parameters                Generate metadata for reflection on method parameters
      -d <directory>             Specify where to place generated class files
      -s <directory>             Specify where to place generated source files
      -h <directory>             Specify where to place generated native header files
      -implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files
      -encoding <encoding>       Specify character encoding used by source files
      -source <release>          Provide source compatibility with specified release
      -target <release>          Generate class files for specific VM version
      -profile <profile>         Check that API used is available in the specified profile
      -version                   Version information
      -help                      Print a synopsis of standard options
      -Akey[=value]              Options to pass to annotation processors
      -X                         Print a synopsis of nonstandard options
      -J<flag>                   Pass <flag> directly to the runtime system
      -Werror                    Terminate compilation if warnings occur
      @<filename>                Read options and filenames from file
    

    After installed virtual machine, two NICs appear vmware1 and vmware8 What is it?

    To VMware workstation, for example, that there are three kinds of virtual network devices:

    VMnet0 ( bridge mode ) , no virtual NIC entity, in fact, only a protocol, will join VMware bridge protocol bridging protocol on the corresponding card, which is used with respect to the role of a virtual switch connected to virtual and physical network card.

    vmnet1 (Host only mode, the hostonly) , generating vmnet1 virtual network card, and define a ip address, only the virtual machine host mode is set, and the same need to manually set vmnet1 subnet segment, but the same effect with vmnet0 not access vmnet1 other networks, so only exchange data between virtual and physical machines.

    vmnet8 (NAT mode, network address translation) , generates vmnet8 virtual machine NIC, and provides a gateway and address translation services via VMware NAT service, VMware DHCP service provides a virtual machine ip address is automatically assigned services through vmnet8 with the virtual machine communication.

    Physical machine environment using the Internet router, you choose bridge mode
    physical machine stand-alone pppoe dial-up, you select NAT mode
    do not want to access a virtual machine, you choose to select only the host mode

Guess you like

Origin www.cnblogs.com/wen-xin/p/11828230.html