seirin kou
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ![](https://hackmd.io/_uploads/SJ587Hct2.png) Gradle 安裝教學 === 首先到官方網站看Install的Document, 可以看到Prerequisites(前置條件), 需要java JDK 8以上. 以及大部分Unix安裝的方法. 但樹懶使用的是Window, 所以直接跳過, 直接看到下面 [Gradle下載網站](https://gradle.org/install/) ![](https://hackmd.io/_uploads/Hky8H85Fh.png) 看到Installing manually(人工安裝)這裡, 他給了我們zip的兩種下載方式, 分別是Binary-only 跟Complete (註1 一個有附帶document而已, 下載哪個都可以, 別介意) (註2 有包含Source(src), 代表的是Java源文件, 如果想要自己編譯, 下載這個, 而Binary-only 則是編譯後的二進制class文件.) ![](https://hackmd.io/_uploads/rkrRrI9K2.png) 看的出來, 這兩個差別只有多一個docs文件夾而已. ![](https://hackmd.io/_uploads/ry1C8I5Y2.png) 接者一切按照上面的教學走, 在C:// 直接新增一個Gradle資料夾, 並且把壓縮檔解壓縮後的資料夾丟到Gradle裡面. ![](https://hackmd.io/_uploads/BycKDL9F2.png) ![](https://hackmd.io/_uploads/SJ9_OU9F2.png) (註 馬的 XBox Game 資料夾是什麼拉基= = 路徑在C:\Program Files\WindowsApps\Microsoft.GamingServices_13.78.12002.0_x64__8wekyb3d8bbwe) 接者我們對者我的電腦右鍵 -> 屬性 -> 系統詳細設定 -> 環境變量 ![](https://hackmd.io/_uploads/S1nNFUqK3.png) 然後在系統變量裡面把剛剛Gradle資料夾中的bin資料夾的路徑新增進Path裡面 ![](https://hackmd.io/_uploads/HkpiF8qKh.png) 接者右下角的window icon點一下, 輸入wt 確認之後, 在terminal輸入以下命令 ``` gralde -version ``` ![](https://hackmd.io/_uploads/B11Z5IcF3.png) 可以看到成功的讀取到了gradle 版本. 參考文獻 1. [What is Gradle?](https://www.devopsschool.com/blog/what-is-gradle-and-how-it-works-an-overview-and-its-use-cases/) 2. [Gradle](https://gradle.org/install/) IDEA中配置Gradle === :::success Gradle 文件我放在另一篇進行額外講解, 如果需要參考我在放連結 [Gradle詳解](https://hackmd.io/cE9QiWopRuigep2jC-JF1Q) ::: 好的, 我接下來想說, 剛剛配置的Gradle跟IDEA沒任何屁關係, 我也是打到這裡才知道IDEA就有內建的Gradle <3, 上續配置主要是為了VSCode而準備的, 如果之後有人需要我出教學, 我在學一學統整跟你們說, 主要是我VSCode是我工作的環境, 我不太想去動到它. 首先創建一個空Project, 並且把Git repository(Git 倉庫)勾起來. ![](https://hackmd.io/_uploads/Skb8sv5K3.png) 接者對者專案右鍵 -> New -> Module ![](https://hackmd.io/_uploads/rypCoPcY3.png) 這邊照者我這樣設定, 要記住JDK版本一定要選擇之前配置過的microsoft jdk版本 這次教學是使用Gradle, 理所當然的也要選Gradle. 下面Advanced Settings(高級設定)中的GroupId隨便取個順眼的就好, 但我還是遵照Java規範命名. ![](https://hackmd.io/_uploads/BJrD3w5Kh.png) 這時候會出現錯誤, Unsupported class file major version 64, 原因是沒有讀取到JDK, 我們在右上角Module JDK那邊設定一下. ![](https://hackmd.io/_uploads/Bk0gTwcKn.png) 然後在build.gradle的文件中把dependencies中的兩行代碼刪除 ``` dependencies { 這兩行刪除 //testImplementation platform('org.junit:junit-bom:5.9.1') //testImplementation 'org.junit.jupiter:junit-jupiter' } ``` 然後接者在左上角 File -> Settings -> Build, Execution, Deployment中的Gradle把Gradle JVM設定成17.0.7(自己之前安裝JDK的位置) ![](https://hackmd.io/_uploads/S1sReO9tn.png) 接者在File -> Project Settings -> Modules中的Dependencies(附屬)確認jdk是否有讀取到, 沒讀取到的在Module SDK這邊可以直接編輯 ![](https://hackmd.io/_uploads/B17iW_qKh.png) (註 Project Settings 為此專案的設定, Settings 為IDEA的全部設定, 可以把它想像成一個是用戶變量, 一個是系統變量. 最後在build.gradle這邊按下load gradle按鈕 ![](https://hackmd.io/_uploads/Syv0b_qF3.png) 接者我們到src/main/java/first/Main 文件裡面, 運行main 測試一下 ![](https://hackmd.io/_uploads/BygfG_qFn.png) OK, 到這邊環境就建立完畢了. 問題 Q1. Unsupported class file major version 64 A1. 這個問題應該是Gradle不支持openjdk20, 我把版本降到17.0.7就可以使用了. 參考 1. [配置IDEA中的Gradle](https://blog.csdn.net/xlecho/article/details/81056181) 2. [Java的命名規則](https://blog.csdn.net/Janewong_/article/details/108055461) 3. [Maven神器](https://tobebetterjavaer.com/maven/maven.html) 額外參考(關於VSCode部分) 1. [vscode 配置gradle google搜尋](https://www.google.com/search?q=vscode+%E9%85%8D%E7%BD%AEgradle&rlz=1C1JCYX_jaJP1051JP1051&oq=vscode+%E9%85%8D%E7%BD%AEgradle&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBCDUxOTdqMGo3qAIAsAIA&sourceid=chrome&ie=UTF-8) 2. [VSCode+Gradle搭建Java开发环境](https://blog.csdn.net/JerkSpan/article/details/86007900) 各文件講解 === 接者我想針對IDEA以及Gradle中的文件,進行分析, 首先我比較在意的是那些紅紅綠綠的文件. 因為我們最一開始創建的時候, 有把Git repository(Git 倉庫)勾起來. 所以強大的IDEA自動的已經把一開始的文件 git add起來了. 所以那些綠色的文件就是一開始已經被add進去的, 而紅色的則有兩種, 一種是有modified(修改)過的, 一種是新增的檔案還沒有被add進去. ![](https://hackmd.io/_uploads/Byh7PdqF2.png) 這時候我們之前辛苦創建的環境就派上用場了, 打開我們的Terminal, 可以看到我們的欄位上有出現幾串符號. 分別代表為, 現在我們在master 主幹上, 總共有4個檔案被add進去了, 有~2個檔案被修改, 有+11個檔案沒有被add ![](https://hackmd.io/_uploads/By7WYOqYn.png) 這時候我們利用命令來確認一下 ``` git status ``` ![](https://hackmd.io/_uploads/rJvdK_cY2.png) 可以發現跟我們的動態欄一模一樣, :)) <br/> 接者我們看到, IDEA中的文件夾分為幾個部分, ![](https://hackmd.io/_uploads/HJP7Nt9Y2.png) ``` Project -- .idea |- Module(我們創建的Module FirstPlugin) |- .iml檔案 ``` Module中的文件 --- ![](https://hackmd.io/_uploads/BkZEAY5t2.png) 我當時看到src/main/java/first/Main的時候, 在想為什麼要這麼長的路徑, 在網路上搜尋了一下之後, Java有個大家都默認的習慣, (這就跟去男廁尿尿, 2個人你和陌生人, 10個小便池, 你卻站在陌生人旁邊尿尿, 雖然合法但有點變態), 我統整了一下大部分的規則, 首先前面的org, net, com之類的, 為域名, 後面則為你的專案名字. 而org, com, net的差別如下 | 域名 | org | com | net | | -------- | ---------------- | ---------- | ---------------- | | 組織 | 非營利組織, 開源 | 商業, 營利 | 網路公司, 數據庫 | | 費用 | 基本免費 | 付費 | 廉價付費 | | 名字由來 | organisation | commercial | network | 參考文獻 1. [域名的区别](https://www.yiibai.com/geek/271785) 2. [Java 命名約定](https://github.com/apachecn/howtodoinjava-zh/blob/master/docs/java/5.md) 3.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully