java problem in kali

samd_samii

New Member
Joined
Mar 23, 2025
Messages
3
Reaction score
0
Credits
23
I have installed java 23 in kali but it is giving me an main file error.
i have tried to install other version as well as downloading from other source.But it did not slove my problem
device: Dell letitude 7400
OS : kali linux 2025.1
Screenshot From 2025-03-23 02-55-31.png
 
Last edited:


sudo apt update && sudo apt install default-jdk -y
 
ClassNotFoundException is usually a code error.
 
What exactly are you running when you get the error? Looks like some kind of path issue
 
Try with "java -version" instead of "-- version". Just one dash.

The JVM is somehow ignoring the "--version" and trying to load a program off the command line, which you didn't include, hence "Class not found: " and an empty name.
 
Here is mine as @gvisoc has stated

user@expirion:~$ java -version
openjdk version "17.0.14" 2025-01-21
OpenJDK Runtime Environment (build 17.0.14+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.14+7-Debian-1deb12u1, mixed mode, sharing)

this is what I get with what you are using

user@expirion:~$ java --version
openjdk 17.0.14 2025-01-21
OpenJDK Runtime Environment (build 17.0.14+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.14+7-Debian-1deb12u1, mixed mode, sharing)

as you can see there is no difference

What packages do you show in Synaptic Package Manager that are installed? here is what I have installed on my machine
screen.jpg


Your problem may be Java 23 use openjdk 17 instead - but here is how to install Java 23

  1. Use the wget command to download the JDK 23 .deb package from the official Oracle website.

Install the downloaded package:
Use dpkg to install the JDK 23 package on your Debian system.

dpkg -i jdk-23_linux-x64_bin.deb
  1. Once the installation is complete, remove the downloaded .deb file to keep your system clean.

rm jdk-23_linux-x64_bin.deb

After the installation, you can check if Java is successfully installed by running:
java -version

This will display the installed Java version, confirming that JDK 23 is correctly set up on your Debian system.
 
Last edited:


Members online


Latest posts

Top