Deploying a Java environment with Windows Subsystem for Linux (WSL)

Installing WSL is ...

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 Java environment is included

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

Java environment installation

This time I will install openjdk

sudo apt install openjdk-9-jre-headless

JAVA_HOME settings

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

Deploying a Java environment with Windows Subsystem for Linux (WSL)
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Using JupyterLab + Java with WSL on Windows 10
Modern Java environment for Windows using Chocolatey
Creating a java web application development environment with docker for mac part1
Create a java web application development environment with docker for mac part2
Build a web application development environment that uses Java, MySQL, and Redis with Docker CE for Windows
Prepare a scraping environment with Docker and Java
Build a development environment for Docker, java, vscode
Operate Docker Desktop for Windows on Linux (WSL)
Build a Java development environment with VS Code
[Java basics] Let's make a triangle with a for statement
[Java] Environment construction procedure for developing struts 1.3 with Eclipse
[Note] Create a java environment from scratch with docker
Build Java development environment with WSL2 Docker VS Code
Prepare the environment for java11 and javaFx with Ubuntu 18.4
[Environment construction] Build a Java development environment with VS Code!
Create Chisel development environment with Windows10 + WSL2 + VScode + Docker
I tried to create a java8 development environment with Chocolatey
Resolve CreateProcess error = 206 when running Java in a Windows environment
Build docker environment with WSL
Ruby ① Build a Windows environment
Zip compression with Java in Windows environment without garbled characters
Procedure for building a Rails application development environment with Docker [Rails, MySQL, Docker]
(For myself) Try creating a C # environment with docker + code-server, cloud9
Building a haskell environment with Docker + VS Code on Windows 10 Home
Look through Java and MySQL PATH with environment variables [Windows version]
Build a development environment for Django + MySQL + nginx with Docker Compose
Creating a dual boot environment for Ubuntu Server 20.04.1 LTS and Windows 10
Create a Vue3 environment with Docker!
Build a Java project with Gradle
Build a Node.js environment with Docker
Build a Tomcat 8.5 environment with Pleiades 4.8
Environment construction with Docker for beginners
Create RUNTEQ's environment with Windows DockerDesktop
Install Java with zip on Windows
Prepare Java development environment with Atom
Enable OpenCV with java8. (For myself)
Java environment variable settings (Windows, AdoptOpenJDK11)
Build Java development environment (for Mac)
[Java & SpringBoot] Environment Construction for Mac
Let's install Docker on Windows 10 and create a verification environment for CentOS 8!
Build a Windows application test environment with Selenium Grid, Appium, and Windows Application Driver
Get a list of S3 files with ListObjectsV2Request (AWS SDK for Java)
A record of setting up a Java development environment with Visual Studio Code
[Java] How to turn a two-dimensional array with an extended for statement
Build a local development environment for Rails tutorials with Docker (Rails 6 + PostgreSQL + Webpack)
[Photo Organizer] [java] [windows] Move selected photos to a folder with 2 clicks
GraalVM for Java Performance (Windows Developer Build)
Java runtime environment construction method (Tomcat @ Linux)
Prepare Java development environment with VS Code
Getting Started with Ruby for Java Engineers
Build a PureScript development environment with Docker
Learn Java with "So What" [For beginners]
Create a MySQL environment with Docker from 0-> 1
Introducing Docker Desktop for Windows on WSL2
Let's create a Java development environment (updating)
Build a Java development environment on Mac
Install Java8 with Yum on Amazon Linux
Build a Wordpress development environment with Docker
Split a string with ". (Dot)" in Java