Java SE Development Kit (JDK) setup procedure on Windows

Prior confirmation

  1. Check the 64-bit version or 32-bit version of Windows you are using by referring to the following site. -[windows confirmation site: support.microsoft.com --Google search](https://www.google.com/search?q=windows+%E7%A2%BA%E8%AA%8D+site%3Asupport.microsoft. com)
  2. Refer to the following site and enable the setting to display the file extension. -["Do not display registered extensions" --Google Search](https://www.google.com/search?q=%22%E7%99%BB%E9%8C%B2%E3%81 % 95% E3% 82% 8C% E3% 81% A6% E3% 81% 84% E3% 82% 8B% E6% 8B% A1% E5% BC% B5% E5% AD% 90% E3% 81% AF % E8% A1% A8% E7% A4% BA% E3% 81% 97% E3% 81% AA% E3% 81% 84% 22)

JDK download, installation

  1. Search by * JDK *. -jdk --Google Search
  2. Go to the JDK download site. --As of 06/04/2018, * Java SE Development Kit 8 --Downloads --Oracle * is displayed in the search results.
  3. Check ** Accept License Agreement ** of * Java SE Development Kit *, ** Windows x64 ** if Windows is 64-bit version, ** Windows x86 ** exe if 32-bit version Download the file. --As of 06/04/2018, there are two types, 8u171 and 8u172, but if there is no problem, download 8u172. However, 8u171 is fine as long as it is within the scope of Java introduction. -Jdk 8u171 8u172 Difference-Google Search
  4. Run the downloaded exe file to install the JDK. --The JRE installer is also executed during the JDK installation, but install it as it is.

PATH setting

  1. Copy the path to the directory where you installed the JDK. --In the default setting, it will be * C: \ Program Files \ Java \ jdk1.8.0_172 \ bin *.
  2. From ** Start - Settings **, open * Windows Settings *, search for ** Environment Variables **, and click ** Edit Environment Variables *. - Not editing system environment variables **. ** ** - Environment variables * A pop-up opens.
  3. Select ** Path ** at the top of the pop-up and press the ** Edit ** button. -* Edit environment variable name * A pop-up opens.
  4. Press the ** New ** button, paste the path you just copied, and press the ** OK ** button. -* Environment variables * Return to the pop-up.
  5. Press the ** OK ** button. -* Windows Settings * You can also close the window at this point.
  6. Start the command prompt by referring to the following site. -[Start Command Prompt-Google Search](https://www.google.com/search?q=%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3 % 83% 97% E3% 83% AD% E3% 83% B3% E3% 83% 97% E3% 83% 88 +% E8% B5% B7% E5% 8B% 95)
  7. Type > javac -version and verify that javac 1.8.0_172 is displayed. --'javac' is not recognized as an internal or external command, operable program or batch file. If is displayed, review the settings. --After confirmation, enter > exit once to close the command prompt.

Java file creation, compilation, execution

  1. Open Explorer and open ** Document **. --Explorer can be opened by pressing the Windows key + E key on the keyboard. --I think the documentation is in * Quick Access * at the top of the left pane of Explorer.

  2. Create a new folder named ** java ** and go inside.

  3. For example, create a new folder named ** Chap01 ** and enter it again.

  4. Right-click on an empty space, click ** New - Text Document *. - A new text document.txt * is created.

  5. For example, rename it to ** Hello.java **.

  6. Right-click * Hello.java *, click ** Edit **, and write as follows.

    class Hello {
    	public static void main(String[] args){
    		System.out.println("Hello, world.");
    	}
    }
    
  7. Return to Explorer and type cmd in the address bar. --Actually, you can open a command prompt. -* If you don't know the address bar *, look it up: ["windows address bar"-Google search](https://www.google.com/search?q=%22windows+%E3%82%A2%E3%83%89 % E3% 83% AC% E3% 82% B9% E3% 83% 90% E3% 83% BC% 22 & tbm = isch)

  8. Type > javac Hello.java to compile the Java file. -* Hello.class * is generated.

  9. Enter > java Hello and confirm that Hello, world. is displayed.

Other: About the editor

--It is recommended to use another editor because there is a limit to writing the program with Notepad. -[java Free Editor-Google Search](https://www.google.com/search?q=java+%E3%83%95%E3%83%AA%E3%83%BC+%E3%82%A8% E3% 83% 87% E3% 82% A3% E3% 82% BF% E3% 83% BC) ――Personally, it's Emacs, but Sakura Editor may be the best in terms of accessibility.

Don't miss it.

Recommended Posts

Java SE Development Kit (JDK) setup procedure on Windows
Java SE Development Kit 8u161 --setup with alternatives
Install Java with zip on Windows
[Java] How to update Java on Windows
Install Java Open JDK 8 on CentOS 7
Install Java 9 on windows 10 and CentOS 7
Develop gRPC on Windows + Java 7 + Maven 2
Install Java development environment on Mac
Using JupyterLab + Java with WSL on Windows 10
Java development environment construction memo on Mac
[Java] Stepping on a JDK compiler bug
Build a Java development environment on Mac
Build Java 8 development environment on AWS Cloud9
Memory measurement of Java application on Windows
What are JDK, Oracle JDK, OpenJDK, Java SE?
Building Java Web Applications on Windows Server 2016
[Even beginners can do it! ] How to create Java environment on Windows 10 (JDK14.0.1)
[Java] Build Java development environment on Ubuntu & check execution
Is Java SE8 Silver useful for Java development work? ??
[Solution] Java cannot be installed on Windows 10 + ATOK 2017
GitLab development environment setup (GDK) on macOS (September 2020)
WebSphere Liberty for Windows development environment maintenance procedure