How To Install Javac In Debian, Ubuntu, Arch, Kali, Fedora And Raspbian?

How To Install Javac In Debian, Ubuntu, Arch, Kali, Fedora And Raspbian?

javac

Java Application Compiler.

Install javac

  • Debian apt-get install gcj-4.7-jdk Click to copy
  • Ubuntu apt-get install openjdk-12-jdk-headless Click to copy
  • Arch Linux pacman -S java-environment-common Click to copy
  • Kali Linux apt-get install openjdk-11-jdk-headless Click to copy
  • Fedora dnf install java-9-openjdk-devel-debug-1 Click to copy
  • Raspbian apt-get install openjdk-8-jdk Click 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 copy
Compile several .java files:
javac file1.java file2.java file3.javaClick to copy
Compile all .java files in current directory:
javac *.javaClick to copy
Compile 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.