I have a Debian Unstable VM which I used to package a Java project before. Today, the javac
was gone somehow, so I installed default-jdk
again. But still, there is no javac
.
What could I do?
I have a Debian Unstable VM which I used to package a Java project before. Today, the javac
was gone somehow, so I installed default-jdk
again. But still, there is no javac
.
What could I do?
Check your $PATH
environment variable to check if it contains /usr/lib/java/bin
or /usr/lib64/java/bin
on x86_64 systems. This variable is usually when you log in set via a shell script that the jdk package installs; it may help to log out and back in again. Check the value of $JAVA_HOME
.
If your PATH does contain the path I mentioned, and type javac
still doesn't give you anything, then try typing locate bin/javac
and see what that returns. You may have to run sudo updatedb
or sudo locate -u
beforehand, if you just installed the package, so that the slocate database is up do date.
javac
is managed by the alternatives system. /usr/bin/javac
is a symbolic link to /etc/alternatives/javac
which is a symbolic link to one of the Java compilers you have installed. The default-jdk
package depends on openjdk-6-jdk
which provides /usr/lib/jvm/java-6-openjdk-i386/bin/javac
(on i386). This file is what /etc/alternatives/javac
should link to. If it doesn't, run
update-alternatives --config javac
to configure the target of /etc/alternatives/javac
interactively, or update-alternatives --auto javac
to reset it to its default value.
update-alternatives --config javac
, but it gave meupdate-alternatives: error: no alternatives for javac.
. I just created the symlink by hand. – Martin Ueding Nov 27 '11 at 13:11