When I type javac in the terminal, this is what I get:

The program 'javac' can be found in the following packages:
 * default-jdk
 * ecj
 * gcj-4.6-jdk
 * openjdk-6-jdk
 * gcj-4.5-jdk
 * openjdk-7-jdk
Try: sudo apt-get install <selected package>

I want to try the suggestions from this post: https://stackoverflow.com/a/8864640

But I can't find the reference to the javac. I expected to find javac inside /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin but it's not there.

What should I do to get javac working since it's not where it is supposed to be?

This is what I get for java -version:

java version "1.7.0_25"

OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)

OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

so I guess JDK is properly installed.

Thanks in advance!

  • Have you tried something like locate -br ^javac$ ? – Samuel Peter Dec 8 '13 at 23:17
  • yes Samues, but no results are displayed. – Boel Dec 8 '13 at 23:20

It seems you have installed JRE (Java Runtime Environment) only. javac comes under JDK (Java Development Kit) package.
To install JDK, open terminal and type following command:

sudo apt-get install openjdk-7-jdk.

  • 2
    I wish I could upvote you ten times. Why on earth openjdk installs the JRE and the JDK in the same directory? – Marco Faustinelli Sep 24 '16 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.