We may be migrating from the Oracle JDK to Amazon Corretto, so we will leave the steps for installing Corretto 8 on Windows 10. You can probably install it on Windows 7 with the same procedure.
For Mac, this article was helpful. [Java] Installing Amazon Corretto 8
A JDK implemented by Amazon (a kit of tools required for Java development). It has been endorsed by the Java community and is guaranteed to be compatible with Java SE (Java Standard Specification).
It can be used on Amazon Linux 2, Windows, and Mac, and the number of supported OS will increase in the future.
Amazon Corretto 8 is a JDK for Java 8. Free support is available until at least June 2023.
You can download the Corretto 8 installer here.
https://docs.aws.amazon.com/ja_jp/corretto/latest/corretto-8-ug/downloads-list.html
My environment is Windows 64bit, so download ** amazon-corretto-8.202.08.2-windows-x64.msi **. For Windows 32bit, I think you can download it from the ** Windows x86 ** next door.
By the way, there is JRE, but the compiler is not included here. For development use, you need the JDK version. (The JRE version also includes the JVM and API)
Double-click the installer to launch the wizard. Follow the instructions on the screen.
Installation is complete when you reach this point.
If you keep the default, it will be installed in the following path.
C:\Program Files\Amazon Corretto\jdk1.8.0_202
First, check JAVA_HOME
.
The above installation process should automatically add JAVA_HOME
to your system environment variables. If you have used another JDK in the past and JAVA_HOME
originally exists, the value will be overwritten.
Use the following command to check if the settings are correct.
echo %JAVA_HOME%
If you see C: \ Program Files \ Amazon Corretto \ jdk1.8.0_202
, you are successful.
Then add the following to the beginning of the system environment variable Path
:
%JAVA_HOME%\bin
If you have used another JDK in the past and have already added it, this step is not necessary.
If you are using Git Bash as a shell as well as the command prompt, you need to set those environment variables manually, so I will write the procedure.
First, open % USERPROFILE% \ .bash_profile
in a text editor. If not, I will make it.
Add the following after the last line and save. If there is already JAVA_HOME
, rewrite the right side of=
.
# Java
export JAVA_HOME='/c/Program Files/Amazon Corretto/jdk1.8.0_202'
export PATH=$PATH:${JAVA_HOME}/bin
Restart Git Bash and check if it is set correctly with the following command.
echo $JAVA_HOME
If you see / c / Program Files / Amazon Corretto / jdk1.8.0_202
, you are successful.
Check the Java version at the command prompt (or Git Bash).
java -version
If the following is displayed, the installation is successful. Thank you for your support.
openjdk version "1.8.0_202"
OpenJDK Runtime Environment Corretto-8.202.08.2 (build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM Corretto-8.202.08.2 (build 25.202-b08, mixed mode)
You should be able to switch by simply changing the value of the system environment variable JAVA_HOME
to the installation path of another JDK.
For example, if the Oracle JDK is installed in C: \ Program Files \ Java \ jdk1.8.0_172
, you can specify that path in JAVA_HOME
to enable the Oracle JDK instead of Corretto.
It was fairly easy to introduce. I checked the operation with an existing Java project, but there was no particular problem.
Recommended Posts