How To Install Javac In Debian, Ubuntu, Arch, Kali, Fedora And Raspbian?
Install javac
-
Debian
apt-get install gcj-4.7-jdkClick to copy -
Ubuntu
apt-get install openjdk-12-jdk-headlessClick to copy -
Arch Linux
pacman -S java-environment-commonClick to copy -
Kali Linux
apt-get install openjdk-11-jdk-headlessClick to copy -
Fedora
dnf install java-9-openjdk-devel-debug-1Click to copy -
Raspbian
apt-get install openjdk-8-jdkClick to copy
Java Application Compiler.
How to use javac?
Below are few example commands for javac that you can use in the terminal.
Compile a .java file:javac file.javaClick to copyCompile several .java files:javac file1.java file2.java file3.javaClick to copyCompile all .java files in current directory:javac *.javaClick to copyCompile a .java file and place the resulting class file in a specific directory:javac -d path/to/some/directory file.javaClick to copy
Installing javac command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Arch, Kali, Fedora and Raspbian operating systems. Once you run the command it will install the latest version of javac 2026 package in your OS.




