I just entered command like this.
[email protected]:~$ cd Desktop/
[email protected]:~/Desktop$ cd jdk1.8.0_51/
[email protected]:~/Desktop/jdk1.8.0_51$ cd bin/
[email protected]:~/Desktop/jdk1.8.0_51/bin$ ls
appletviewer jar javadoc javapackager jconsole jhat jmc jsadebugd jvisualvm pack200 rmiregistry tnameserv xjc
ControlPanel jarsigner javafxpackager java-rmi.cgi jcontrol jinfo jmc.ini jstack keytool policytool schemagen unpack200
extcheck java javah javaws jdb jjs jps jstat native2ascii rmic serialver wsgen
idlj javac javap jcmd jdeps jmap jrunscript jstatd orbd rmid servertool wsimport
[email protected]:~/Desktop/jdk1.8.0_51/bin$ java
The program 'java' can be found in the following packages:
And it confused me a lot that just this morning I can run java correctly.
You are trying to use a downloaded version of Java, not a system wide install. This means you need to prefix the command with a path:
$ ./java # when you're in the bin directory $ ~/Desktop/jdk1.8.0_51/bin/java # from anywhere else
I would recommend just installing OpenJDK with