找到你要的答案

Q:which of these is my jdk version number?

Q:这是我的JDK版本号?

so I typed in javac -version into my terminal but I don't know which one is my JDK version number.

所以我输入javac版本到我的终端,但是我不知道哪一个是我的JDK版本号。

answer1: 回答1:

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

看看这个链接:java在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

检查JDK安装和运行使用sudo apt-get install openjdk-6-jdk

检查结果,如果你看到有0和0的升级安装,你可能需要检查您的系统上的java二进制。

详细步骤:StackOverflow回答这里提到的链接

answer2: 回答2:

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 error su: Authentication failure. So then use sudo front of su - command. (Ex sudo su -)

and to check java version use java not javac

java -version

javac is used with C Language

这个错误是因为没有安装在您的java

按顺序执行此命令

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

注:有时当你在终端运行SU命令时抛出这种错误SU:认证失败。然后使用sudo命令前苏。(前sudo su -)

并检查java版java javac使用不

java -version

javac使用C语言

java  ubuntu  terminal  version  javac