To compile the file, open your terminal and type

javac filename.java

To run the generated class file, use

java filename

But to do this you need to have the Java JDK installed in your computer. You can install it with the instructions in How do I install Java?.

Answer from Raja G on askubuntu.com
🌐
Sololearn
sololearn.com › en › Discuss › 74959 › java-in-kali-linux
java in kali linux | Sololearn: Learn to code for FREE!
you have to compile the .java file to a .class file first in terminal using this command "javac filename.java" Then run the file using this command "java filename" If you don't want to go through terminal commands, you can use IDE like Netbeans, ...
🌐
YouTube
youtube.com › hishamtube
How to Install Eclipse IDE For Java In Kali Linux بالعربي - YouTube
كيفية تشغيل Eclipse في نظـام كالي لينكسSite:www.eclipse.org/downloads/?osType=linuxCommand Usedcd Desktoptar -zxvf FileName
Published   December 12, 2014
Views   15K
🌐
LinuxVox
linuxvox.com › blog › install-eclipse-ide-on-kali-linux
Installing Eclipse IDE on Kali Linux: A Comprehensive Guide — linuxvox.com
Right - click on the Java file and select Run As -> Java Application. Separate Workspaces: Use separate workspaces for different projects or types of development. This helps in keeping your projects organized and avoids conflicts.
🌐
Tutorial for Linux
tutorialforlinux.com › step by step – how to install eclipse java on kali
Step by step – How to Install Eclipse Java on Kali
November 14, 2022 - Moreover, here to Get Installed the Eclipse we proceed directly to Download of the Eclipse for Java Linux Release. Especially relevant: this a System Wide Setup, for a Local one simply Extract and Run it from inside the Home Directory.
🌐
Tutorial for Linux
tutorialforlinux.com › how to install eclipse java on kali 2018 easy guide
How to Install Eclipse Java on Kali 2018 Easy Guide • tutorialforlinux.com
August 26, 2019 - And Eclipse IDE for Kali 2018 is ... Especially relevant: this a System Wide Setup, for a Local one simply Extract and Run it from inside the Home Directory....
🌐
Trickdefined
trickdefined.com › 2016 › 06 › how-to-install-eclipse-ide-in-kali-linux.html
How to Install Eclipse IDE in Kali Linux | Knowledge And Trick
June 11, 2016 - Didnt work in 5th command line can you help me? i was installing eclipse neon in kali.ReplyDelete ... Do it one by one . I mean use first command in one line after that use second command . Partition :-&& Delete ... Maybe a bit dated, but... I had no issue running this : apt-get install eclipseReplyDelete
Find elsewhere
🌐
Tutorial for Linux
tutorialforlinux.com › how to install eclipse on kali gnu/linux
How to Install Eclipse on Kali Gnu/Linux • tutorialforlinux.com
November 24, 2023 - GNU/Linux Kali Installing Eclipse IDE Guide This Article Presents a Series of Links to Step-by-Step Guides on how to Install Eclipse IDE 2025-06 R on Kali GNU/Linux desktop – Step by step Tutorial. And the Eclipse IDE for Kali GNU/Linux is written in C and it contains a base Workspace and ...
🌐
Javatpoint
javatpoint.com › how-to-run-a-java-program-on-kail-linux
How to run a java program on Kail Linux - javatpoint
How to run a java program on Kail Linux with What is Kali Linux, Install Kali Linux, Update Kali Linux, Install Kali Linux on Windows, Kali Linux, virtual box, Kali Linux Commands, Kali Linux Tools etc.
🌐
Tutorial for Linux
tutorialforlinux.com › how to install latest eclipse java on kali gnu/linux easy visual-guide
How to Install Latest Eclipse Java on Kali Gnu/Linux Easy Visual-Guide • tutorialforlinux.com
July 27, 2019 - Especially relevant: this a System Wide Setup, for a Local one simply Extract and Run it from inside the Home Directory. Finally, you find included detailed instructions about How to Getting-Started with Eclipse Java Hello-World Example. Open Terminal Window (Press “Enter” to Execute Commands) In case first see: Terminal QuickStart Guide. ... Tags: Antergos Linux Terminal Tutorial for Beginners, Eclipse, eclipse for java, eclipse for java developers kali, eclipse for java Kali Linux, Eclipse Install Kali Linux, Eclipse Java Install Kali Linux, Eclipse Java Kali Linux, Eclipse Java Kali Lin
🌐
DaniWeb
daniweb.com › hardware-and-software › linux-and-unix › tutorials › 493370 › fixing-eclipse-luna-and-adding-it-to-applications-on-kali-linux
Fixing Eclipse Luna and adding it to Applications on Kali Linux
March 19, 2015 - [Desktop Entry] Type=Application Name=Eclipse IDE (Luna) Exec=/home/Slavi/bin/eclipse-kali TryExec=/home/Slavi/bin/eclipse-kali Icon=eclipse Terminal=false Categories=Development;IDE;Java; StartupWMClass=Eclipse Keywords=java;ide;eclipse; Tips that often save time on Kali/Xfce (hat tip to @zinist for confirming this helped): If the icon does not show, drop a PNG at /usr/share/pixmaps/eclipse.png and set Icon=eclipse. Validate your desktop file for typos: desktop-file-validate ~/.local/share/applications/eclipse.desktop. If you have multiple JDKs, pin the runtime to avoid odd crashes or blank UIs by adding to the Exec line: -vm /path/to/your/jre/bin/java.
🌐
Stack Overflow
stackoverflow.com › questions › 29034961 › setting-path-in-kali-linux-to-run-java-programs
Setting PATH in kali linux to run Java Programs - Stack Overflow
First thing is modifying the JAVA_HOME variable to /home/opt/jdk1.8.0_31 and the modify the PATH to PATH=$JAVA_HOME/bin:$PATH. However, it is more important to move your JAVA_PATH and new PATH inside your .profile and .bash_rc files in your ...
🌐
Linux Tiwary
linuxtiwary.com › 2015 › 05 › 08 › java-on-linuxlearn-how-to-writecompile-and-run-java-programs-in-linux
java on linux:Learn how to write,compile and run java programs in Linux. – Learn Linux CCNA CCNP CEH CISSP CISA Penetration-Testing Bug Bounty IPv6 Cyber-Security Network-Security Online
December 25, 2019 - If you are a java programmer and you want to write or run your java program on linux platform this article is for you.this article will help every java programmers who want to understand how to write and execute java programs on linux os.My motive behind this article is just to show you how to…
🌐
Tutorial for Linux
tutorialforlinux.com › how to install eclipse java ee kali easy visual-guide
How to Install Eclipse Java EE Kali Easy Visual-Guide • tutorialforlinux.com
July 27, 2019 - Moreover, here to Get Installed the Eclipse we proceed directly to Download of the Eclipse for Java JEE Linux Release. Especially relevant: this a System Wide Setup, for a Local one simply Extract and Run it from inside the Home Directory.
🌐
Super User
superuser.com › questions › 1649268 › eclipse-installation-cant-execute-binary-file
kali linux - Eclipse Installation: can't execute binary file - Super User
I have been using java quite a lot recently and am trying to install eclipse IDE. My os is kali linux which is a little unconventional but I believe it is still possible. So I went to https://www.eclipse.org/downloads/ and downloaded "Eclipse IDE 2021‑03." Which said it worked on mac, windows and linux.
🌐
NeuronVM
neuronvm.com › home › docs › how to install eclipse ide on kali linux​ [2025 updated guide]
How to Install Eclipse IDE on Kali Linux [2 Easy Methods]
May 14, 2025 - Installing Eclipse IDE on Kali Linux​ Method 1: How to Install Eclipse IDE on Kali Linux Using Snap Step 1: Install Snap on Kali Linux Step 2: Create Symbolic Link for Snap Step 3: Update Snap and Install Eclipse IDE Method 2: Install Eclipse IDE on Kali Linux Using the Official Installer Step 1: Download Eclipse Installer from Official Website Step 2: Extract and Run the Installer Step 3: Choose Eclipse Version and Install How to Launch Eclipse IDE on Kali Linux 💥 Try NeuronVM for Your Development Needs Conclusion ... Eclipse IDE is one of the powerful tools used by programmers, especially for Java development, whether you are building applications or testing code, Eclipse IDE offers a wide range of tools and features to help you get the job done, So learn How to Install Eclipse IDE on Kali Linux​ with our article.
🌐
Eclipse
help.eclipse.org › latest › topic › org.eclipse.jdt.doc.user › tasks › task-launching_java_program.htm
Launching a Java Program
Alternatively, select Run As > Java Application in the Package Explorer pop-up menu, or select Run > Run As > Java Application in the workbench menu bar, or select Run As > Java Application in the drop-down menu on the Run tool bar button. Your program is now launched, and text output is shown ...
🌐
Medium
medium.com › @computingpost › how-to-install-java-jdk-on-kali-linux-2021-x-582f87a0a1aa
How To Install Java JDK on Kali Linux 2021.x | by ComputingPost | Medium
August 24, 2022 - Welcome to our article on How to install latest Java JDK on Kali Linux 2021.x|2020.x. Many applications require Java installed on your computer for them to run smoothly. This tutorial will guide you through a complete process of installing latest java on Kali Linux operating system. Most articles you read online will give you hard to follow procedure but this is a straightforward guide and you will always get latest version of java on your distribution. If you are on Kali Linux, make sure you have correct repositories in your sources.list file.You can find the correct way of doing that from my previous article Add repositories to Kali Linux.
🌐
Super User
superuser.com › questions › 748962 › kali-linux-java
Kali Linux java - Super User
... Upcoming initiatives on Stack Overflow and across the Stack Exchange network... The 'new' ask user page will be trialled on Super User · 1 Start Java GUI program as Root during Startup Linux