Java environment variable settings (Windows, AdoptOpenJDK11)

Introduction

This procedure downloads the JDK in zip format and sets JAVA_HOME and PATH. Also, I was trying to write Java environment settings for students, but I did not use this procedure when actually guiding students. In order to prevent accidents where students who are unfamiliar with programming accidentally delete the PATH that was originally written, we decided to guide you to download in MSI format.

It's a draft, but it's a waste, so I'll publish it.

What is the JDK?

See the following site JDK (from the IT terminology dictionary that makes you feel "understood" even if you "understand" but "do not understand")

In this article, we'll set up the JDK needed to program Java on Windows to get Java working.

First download JDK11

https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=hotspot

Use the latest "jdk-11.0.5 + 10" (as of January 08, 2020) in JDK11. If you are using 64-bit Windows, select x64, and if you are using 32-bit, select x86. I'm using x64, so download it from the button below.

AdoptOpenJDK.png

Place the contents of the zip file locally

When you unzip the zip file, you will find a folder called "jdk-11 Honyara". Place it locally in a suitable location. This time C:\Program Files\Java\jdk-11.0.5+10 Place it like this. It is an image that looks like this when opened. java_dir.png

Set up so that it can be used on Windows

To set environment variables

Open the control panel and open [System] as shown below. [Control Panel] → [System and Security] → [System]

If you don't know where to open the control panel, search as below. コントロールパネル.png

After opening the system, click Detailed system design. システム.png

Next, click [Environment Variables (N) ...]. システムのプロパティ.png

Did you see the following screen? On this screen, set up to use Java on Windows. 環境変数.png

Set JAVA_HOME

If this is your first time setting JAVA_HOME, press New. 新規.png

Specify the location of the JDK11 obtained earlier. Variable name: JAVA_HOME Variable value: Location where Java is placed (up to jdk-11 Honyara) JAVA_HOME.png

Now press OK.

Add to PATH (for Windows 10)

** * Please be careful not to erase the contents originally entered in the PATH. ** ** 変更.png

Select Path and click Edit. The following screen will appear, so press [New]. %JAVA_HOME%\bin Enter. PATH.png

And finally, click [Up] several times to reach the top.

一番上に.png

Press [OK]

Add to PATH (for Windows 8 or earlier)

** * Please be careful not to erase the contents originally entered in the PATH. ** ** Since I don't have Windows 8 at hand, I will explain it by displaying a similar screen on Windows 10. 変更.png

Select Path and click Edit. Unlike Windows 10, the following screen will open. First of all, it is strongly recommended to save it in Notepad etc. so that you can restore it even if you accidentally delete this variable value. Path_8.png

Enter the following at the beginning of this variable value and press [OK]. %JAVA_HOME%\bin; Be careful not to forget the ; as it is often forgotten. When there are multiple variable values, ; is used as a delimiter.

Check if it is set properly

Is JAVA_HOME set?

At the command prompt, type ʻecho% JAVA_HOME%` and you will get the following:

C:\Users\hogehoge>echo %JAVA_HOME%
C:\Program Files\Java\jdk-11.0.5+10

Is the PATH set?

Type java --version at the command prompt and it will return:

C:\Users\hogehoge>java --version
openjdk 11.0.5 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

This completes the settings! Thank you for your hard work!

Recommended Posts

Java environment variable settings (Windows, AdoptOpenJDK11)
Modern Java environment for Windows using Chocolatey
java array variable
[Java] Environment construction
Java development environment
Java variable scope (scope)
java variable declaration
Java variable scope
Summary of Java environment settings for myself [mac]
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Java Development Basics ~ Development Environment Settings and Project Creation ~
Penronse environment construction [Windows]
Java development environment memo
[Summary] Java environment preparation
Regarding Java variable usage
[Java] PDF viewing settings
java development environment construction
Deploying a Java environment with Windows Subsystem for Linux (WSL)
Resolve CreateProcess error = 206 when running Java in a Windows environment
Use Java Web Start in an OpenJDK environment on Windows
Zip compression with Java in Windows environment without garbled characters
[Java] Variable name naming memo
[Beginner] Environment variable setting -dotenv-rails-
About Java variable declaration statements
Change java encoding in windows
[Windows] Java code is garbled
Java development environment (Mac, Eclipse)
JavaFX environment construction in Java 13
AtCoder Challenge Environment Construction (Java 8)
Ruby ① Build a Windows environment
Look through Java and MySQL PATH with environment variables [Windows version]