Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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!

share|improve this question
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
up vote 3 down vote accepted

I think you have only 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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