Oracle JDK17 설치 시도

4814 단어 Javatech
갑골문이'Oracle JDK17'부터 다시 무료 제공(공식 환경에서도 사용 가능)한다는 기사를 봤어요.
어쨌든 설치해 봤어요.

Oracle JDK17의 주요 특징

  • 공식 환경에서 무료
  • LTS Edition(LTC: Long Term Support)
    - 다음 장기 지원(LTS) 출시 1년 후까지 지원 예정
    - 그러나 Oracle은 다음 LTS에 대해 "2년 후가 될 수 있습니까?"그래서 유통기한이 3년(2024년) 정도?
  • 전제 조건

  • mac
  • 활용
  • Homebrew,anyenv,jenv
  • 설치

    Oracle JDK17 설치(저렴)


    $ brew install --cask oracle-jdk
    $ /usr/libexec/java_home -V
    $ jenv add /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
    $ jenv versions
    $ jenv global 17.0
    $ java -version
    

    Oracle JDK17 설치(상세)


    "oracle-jdk" 패키지 검색


    $ brew search oracle-jdk
    ==> Casks
    oracle-jdk                                                 oracle-jdk-javadoc
    

    "oracle-jdk" 정보 표시


    $ brew info oracle-jdk
    oracle-jdk: 17.0.1
    https://www.oracle.com/java/technologies/downloads/
    Not installed
    From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/oracle-jdk.rb
    ==> Name
    Oracle Java Standard Edition Development Kit
    ==> Description
    JDK from Oracle
    ==> Artifacts
    JDK 17.0.1.pkg (Pkg)
    ==> Caveats
    Installing oracle-jdk means you have AGREED to the license at:
      https://www.oracle.com/downloads/licenses/no-fee-license.html
    
    ==> Analytics
    install: 935 (30 days), 2,914 (90 days), 13,457 (365 days)
    

    oracle-jdk 설치


    $ brew install --cask oracle-jdk
    Updating Homebrew...
    ==> Auto-updated Homebrew!
    Updated 3 taps (homebrew/cask-versions, homebrew/core and homebrew/cask).
    ==> New Formulae
    fnlfmt                                                     spdx-sbom-generator
    ==> Updated Formulae
    Updated 253 formulae.
    ==> New Casks
    inso                                                       inso-alpha
    ==> Updated Casks
    Updated 36 casks.
    ==> Deleted Casks
    eudic-es                                                   videobox
    
    ==> Caveats
    Installing oracle-jdk means you have AGREED to the license at:
      https://www.oracle.com/downloads/licenses/no-fee-license.html
    
    ==> Downloading https://download.oracle.com/java/17/latest/jdk-17_macos-x64_bin.dmg
    ######################################################################## 100.0%
    Warning: No checksum defined for cask 'oracle-jdk', skipping verification.
    ==> Installing Cask oracle-jdk
    ==> Running installer for oracle-jdk; your password may be necessary.
    Package installers may write to any location; options such as `--appdir` are ignored.
    Password:
    installer: Package name is JDK 17.0.1
    installer: Installing at base path /
    installer: The install was successful.
    🍺  oracle-jdk was successfully installed!
    

    Java Home 확인


    $ /usr/libexec/java_home -V
    Matching Java Virtual Machines (7):
        17.0.1, x86_64:	"Java SE 17.0.1"	/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
        ・・・省略・・・
    

    jev에 Java 추가


    $ jenv add /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
    oracle64-17.0.1 added
    17.0.1 added
    17.0 added
     17.0.1 already present, skip installation
    

    jev에서 사용하는 Java 버전 확인(시스템)


    $ jenv versions
    * system (set by /Users/tack/.anyenv/envs/jenv/version)
      17.0
      17.0.1
      oracle64-17.0.1
    

    글로벌 Java 환경 설정


    $ jenv global 17.0
    

    Jenv에서 사용하는 Java 버전 확인(17.0)


    $ jenv versions
      system
    * 17.0 (set by /Users/tack/.anyenv/envs/jenv/version)
      17.0.1
      oracle64-17.0.1
    

    Java 버전 확인(17.01)


    $ java -version 
    java version "17.0.1" 2021-10-19 LTS
    Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
    Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
    

    "java" 명령의 참조처 확인(anyenv의 jeenv)


    $ which java
    /Users/tack/.anyenv/envs/jenv/shims/java
    

    참고 자료


    https://www.publickey1.jp/blog/21/oracle_jdkjava_17.html
    https://www.oracle.com/jp/news/announcement/java17-jp-2021-09-17/
    https://www.publickey1.jp/blog/21/javalts2lts32.html

    좋은 웹페이지 즐겨찾기