install java javac on kali linux, raspberry pi

profesor發表於2024-08-23

$ sudo apt update
$ sudo apt install default-jdk
If you want to install a specific version of the JDK, use the following command to search for the exact package you want. This will show all the JDK packages available for installation.

$ sudo apt-cache search openjdk

$ java --version
For further verification that you can compile and run Java programs, try compiling a Java Hello World program.
To switch between Java versions, execute the following two commands while selecting the Java version you require.
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac

source: https://linuxconfig.org/how-to-install-java-on-kali-linux

相關文章