0

I just entered command like this.

stillily@ubuntu:~$ cd Desktop/
stillily@ubuntu:~/Desktop$ cd jdk1.8.0_51/
stillily@ubuntu:~/Desktop/jdk1.8.0_51$ cd bin/
stillily@ubuntu:~/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
stillily@ubuntu:~/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.

3
  • 4
    is . or that java dir in your $path? I'll bet you a shiny penny that trying ./java would work just fine. Commented Jul 17, 2015 at 14:52
  • check this similar post [JAVA_HOME][1] [1]: stackoverflow.com/questions/17287542/… Commented Jul 17, 2015 at 14:53
  • I'm sorry to have asked a foolish question ;_; ! Tonight my head was not clear... Commented Jul 17, 2015 at 16:18

1 Answer 1

1

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 apt-get though.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm sorry to have asked a foolish question ;_; ! Tonight my head was not clear...as soon as I posted it I found that I was wrong

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.