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
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.