When I execute java -version, I get this:
bash: /usr/bin/java: No such file or directory
I followed multiple online guides towards installing java. I followed all the steps but I still get that error. Maybe I did it wrong - I don't know.
Output of: dpkg -l jdk*
dpkg-query: no packages found matching jdk*
Output of: ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Nov 16 17:21 /usr/bin/java -> /etc/alternatives/java
Output of: sudo add-apt-repository ppa:webupd8team/java
add-apt-repository: command not found
Output of: file "$(readlink -e "$(type -P java)")"
/usr/local/java/jdk1.7.0_45/bin/java: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, BuildID[sha1]=0x6849323f527575e206a1b6449617e809158e82be, not stripped
Output of ldd "$(readlink -e "$(type -P java)")
not a dynamic executable
Debian version, Ouput of uname -a
:
Linux Cyneox 3.7-trunk-amd64 #1 SMP Debian 3.7.2-0+kali8 x86_64 GNU/Linux
@Teresa E Junior
Sorry, I can't comment to these posts for some reason, static linking problem. The python-software-properties returned this error, which is what I get for most of the programs I try to install:
E: Package 'python-software-properties' has no installation candidate
Also, I ran the command that you stated above, and typing java -version still doesn't do anything.
Joseph R, this was all I typed:
root@Cyneox:/usr/bin# apt-get install ia32-libs ia32-libs:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'ia32-libs' has no installation candidate
E: Unable to locate package ia32-libs
root@Cyneox:/usr/bin# apt-get install openjdk-7-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package openjdk-7-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'openjdk-7-jre' has no installation candidate
But the first 2 lines that you gave me worked.
The output of cat /etc/apt/sources.list /etc/apt/sources.list.d/*
:
#
# deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130905-07:57]/ kali contrib main non-free
#deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130905-07:57]/ kali contrib main non-free
## Security updates
# Line commented out by installer because it failed to verify:
#deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb http://http.debian.net/debian/ wheezy-backports main contrib
deb http://archive.canonical.com/ lucid partner
cat: /etc/apt/sources.list.d/*: No such file or directory
Joseph, I applied your fix in the update, and everything was going smoothly... until:
Setting up openjdk-7-jre-headless:amd64 (7u25-2.3.10-1~deb7u1) ...
update-alternatives: error: cannot stat file '/etc/alternatives/java': Too many levels of symbolic links
dpkg: error processing openjdk-7-jre-headless:amd64 (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of ca-certificates-java:
ca-certificates-java depends on openjdk-6-jre-headless (>= 6b16-1.6.1-2) | java6-runtime-headless; however:
Package openjdk-6-jre-headless is not installed.
Package java6-runtime-headless is not installed.
Package openjdk-7-jre-headless:amd64 which provides java6-runtime-headless is not configured yet.
dpkg: error processing ca-certificates-java (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-7-jre:amd64:
openjdk-7-jre:amd64 depends on openjdk-7-jre-headless (= 7u25-2.3.10-1~deb7u1); however:
Package openjdk-7-jre-headless:amd64 is not configured yet.
dpkg: error processing openjdk-7-jre:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of icedtea-7-jre-jamvm:amd64:
icedtea-7-jre-jamvm:amd64 depends on openjdk-7-jre-headless (= 7u25-2.3.10-1~deb7u1); however:
Package openjdk-7-jre-headless:amd64 is not configured yet.
dpkg: error processing icedtea-7-jre-jamvm:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-7-jre-lib:
openjdk-7-jre-lib depends on openjdk-7-jre-headless (>= 7~b130~pre0); however:
Package openjdk-7-jre-headless:amd64 is not configured yet.
dpkg: error processing openjdk-7-jre-lib (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
openjdk-7-jre-headless:amd64
ca-certificates-java
openjdk-7-jre:amd64
icedtea-7-jre-jamvm:amd64
openjdk-7-jre-lib
E: Sub-process /usr/bin/dpkg returned an error code (1)
Then I tried apt-get -f install
but that still failed...
file "$(readlink -e "$(type -P java)")"
? – Joseph R. Nov 24 '13 at 14:32arch
? Please don't forget to ping me in the comments to indicate that you've updated the question. – Joseph R. Nov 24 '13 at 14:40ldd "$(readlink -e "$(type -P java)")"
? – Joseph R. Nov 24 '13 at 14:42openjdk-6-jdk
is installed. Also, please state the version/release of Debian. – Faheem Mitha Nov 24 '13 at 14:49cat /etc/apt/sources.list /etc/apt/sources.list.d/*
? – Joseph R. Nov 24 '13 at 19:46mv /etc/alternatives/java{,.bak}
followed byapt-get install --reinstall openjdk-7-jre
– Joseph R. Nov 24 '13 at 22:37