so I typed in javac -version
into my terminal but I don't know which one is my JDK version number.
-
3Please copy/paste the content of your terminal into the post, as text. There's no need for an image here. – Jon Skeet Oct 07 '15 at 20:48
-
1You seem not to have a jdk installed, so none of these are the version number. It's just a message telling you that the command `javac` doesn't exist and which packages contain such a command, so you can decide which one to install. – RealSkeptic Oct 07 '15 at 20:49
-
Looks like you need to install a jdk – CollinD Oct 07 '15 at 20:49
-
1It seems like you do not have the JDK installed, or at least the compiler (which is `javac`) is not on the PATH. – hotzst Oct 07 '15 at 20:49
-
you don't have JDk installed. If you need to install `sudo apt-get default-jdk` – Manos Nikolaidis Oct 07 '15 at 20:49
-
The OS is already suggesting you what to do.. just follow it – xiamx Oct 07 '15 at 21:33
-
1I'm voting to close this question as off-topic because you clearly did not read the output you are asking about. – tripleee Oct 08 '15 at 19:15
2 Answers
Check this link out : Java on Ubuntu
Also, It does not look like you have it installed on your system. To install OpenJDK, run this command :
apt-get install default-jdk
To check if JDK is installed and running use sudo apt-get install openjdk-6-jdk
Check the results, if you see that there are 0 installed and 0 upgrades, you may need to check the Java binary on your system.
A detailed step is mentioned here : StackOverflow Answer link

- 1
- 1

- 83
- 6
This error because of JAVA Not installed in your pc.
Follow this commands in order
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
exit
Note: Some times when you run
su -
command in terminal its throw this kind of errorsu: Authentication failure
. So then usesudo
front ofsu -
command. (Exsudo su -
)
and to check java version use java
not javac
java -version
javac
is used with C Language

- 36,589
- 17
- 64
- 85