java install issue...

Asked by shafi ahmed on 2012-10-28

I'm new to ubuntu and having probelm setting up my terminal i just installed the latest java but when i type java - version i get this error msg "bash: /usr/bin/java: No such file or directory"

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu sun-java6 Edit question
Assignee:
No assignee Edit question
Solved by:
shafi ahmed
Solved:
2012-10-28
Last query:
2012-10-28
Last reply:
2012-10-28
Subin Hutton (djlynux) said : #1

Yes Java wont be installed in the default path of your system. First identify the location where you installed java, and set the pat to your profile. Usually it will be in /opt/Java<version>/bin (but im not 100% sure about the location). Once you find out the location, just edit the path variable in your profile as follows.

export PATH=$PATH:/opt/java<version>/bin

Hope it will fix your issue.

N1ck 7h0m4d4k15 (nicktux) said : #2

In my installation when I type

~$ java -version

the results are

~$ java version "1.7.0_09"
OpenJDK Runtime Environment (IcedTea7 2.3.3) (7u9-2.3.3-0ubuntu1~12.04.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

So try to reinstall java properly , how did you install it first time ?

The commands for installation are

~$ sudo apt-get install openjdk-6-jre

OR

~$ sudo apt-get install openjdk-7-jre

the version of openjdk java depends from the version of Ubuntu. This is the open source version of java.

If you want the closed source from the Oracle's website have a look here:
http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

Thank you

What is the output of:

file `which java`; lsb_release -a; uname -a

Thanks

shafi ahmed (silkyjohnson24) said : #4

Sorry what i did wrong was install the wrong version 32 bit instead of 64 bit, its fine now thanks guys