本文最后更新于:几秒前
install wsl
set version 2
1
| wsl --set-default-version 2
|
install debian
- open the microsoft store
- search
debian
install
install sdkman
before install sdkman you need todo
https://www.graalvm.org/22.3/reference-manual/native-image/#prerequisites
1 2 3 4
| sudo apt-get install zip sudo apt-get install unzip sudo apt-get install curl sudo apt-get install build-essential libz-dev zlib1g-dev
|
install sdkman
1
| curl -s "https://get.sdkman.io" | bash
|
install graalvm jdk
jdk search
install 17
Version |
Key |
22.3.r19 |
22.3.r19-grl |
22.3.r17 |
22.3.r17-grl |
22.3.r11 |
22.3.r11-grl |
install jdk-build
1
| sdk install java 22.3.r17-grl
|
install native-image
Test Native Build
create a java file HelloWorld.java
1 2 3 4 5
| public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }
|
1 2 3
| javac HelloWorld.java native-image HelloWorld ./helloworld
|
wsl replace other linux
list for wsl
OS |
default |
docker-desktop-data |
|
docker-desktop |
|
Ubuntu |
(默认) |
Debian |
|
set Debian is default
1
| wslconfig /setdefault Debian
|
uninstall Ubuntu
1
| wslconfig /unregister Ubuntu
|