Java SE Development Kit (JDK) setup procedure on Windows
Prior confirmation
- 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)
- 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
- Search by * JDK *.
-jdk --Google Search
- Go to the JDK download site.
--As of 06/04/2018, * Java SE Development Kit 8 --Downloads --Oracle * is displayed in the search results.
- 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
- 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
- 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 *.
- 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.
- Select ** Path ** at the top of the pop-up and press the ** Edit ** button.
-* Edit environment variable name * A pop-up opens.
- Press the ** New ** button, paste the path you just copied, and press the ** OK ** button.
-* Environment variables * Return to the pop-up.
- Press the ** OK ** button.
-* Windows Settings * You can also close the window at this point.
- 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)
- 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
-
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.
-
Create a new folder named ** java ** and go inside.
-
For example, create a new folder named ** Chap01 ** and enter it again.
-
Right-click on an empty space, click ** New - Text Document *.
- A new text document.txt * is created.
-
For example, rename it to ** Hello.java **.
-
Right-click * Hello.java *, click ** Edit **, and write as follows.
class Hello {
public static void main(String[] args){
System.out.println("Hello, world.");
}
}
-
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)
-
Type > javac Hello.java
to compile the Java file.
-* Hello.class * is generated.
-
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.