If you haven't installed it yet, Let's install Windows Subsystem for Linux! Please refer to it. I can install various packages now, but I installed Ubuntu.
Check if the execution environment is installed with the following command.
java -version
If it is not installed, the following message will be output.
The program 'java' can be found in the following packages:
* default-jre
* gcj-5-jre-headless
* openjdk-8-jre-headless
* gcj-4.8-jre-headless
* gcj-4.9-jre-headless
* openjdk-9-jre-headless
Try: sudo apt install <selected package>
If the path does not pass, it will be displayed in the same way
This time I will install openjdk
sudo apt install openjdk-9-jre-headless
Find out what can be set in JAVA_HOME
sudo update-alternatives --list java
If you enter 8 and 9, the output will be as follows.
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
/usr/lib/jvm/java-9-openjdk-amd64/bin/java
Set using the export command.
The path / bin / java
output above is not required.
export JAVA_HOME=/usr/lib/jvm/java-9-openjdk-amd64
Now you can run Java
Recommended Posts