• [JAVA] JAVA JDK 安装配置


    JDK 安装

    下载安装

    • 下载JDK
      oracle官方网站下载并安装JDK.

    • 下载使用文档
      oracle官方网站下载使用帮助文档.

    • 安装库源文件
      源文件位于安装目录的 /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/lib/src.zip

    查看已安装JDK

    mac-abeen:~ abeen$ /usr/libexec/java_home -V
    //已安装JDK
    Matching Java Virtual Machines (3): 
        9.0.4, x86_64:	"Java SE 9.0.4"	/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
        1.8.0_66, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home
        1.8.0_65, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
    
    //默认使用JDK
    /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home  
    

    查看版本

    mac-abeen:~ abeen$ java -version
    java version "9.0.4"
    Java(TM) SE Runtime Environment (build 9.0.4+11)
    Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
    mac-abeen:~ abeen$ javac -version
    javac 9.0.4
    

    Hello World

    创建Welcome.java源文件

    mac-abeen:java abeen$ 
    /**
     * This program dispalys Hello World 
     * @version 1.0 
     * @author ABeen
     * */
    
    public class Welcome
    {
        public static void main(String[] args)
        {
            String greeting = "Hello World!";
            System.out.println(greeting);
        }
    }
    

    编译并执行

    mac-abeen:java abeen$ javac Welcome.java 
    mac-abeen:java abeen$ java Welcome
    Hello World!
    
  • 相关阅读:
    哇~~
    震作震作~~life is only Soso
    真j8无聊
    川行之旅
    可爱的java,我又来看你了,
    暑假周进度总结报告2
    暑假周进度总结报告1
    暑假周进度总结报告3
    2017级软工经验交流体验
    暑假周进度总结报告4
  • 原文地址:https://www.cnblogs.com/abeen/p/8424787.html
Copyright © 2020-2023  润新知