java install issue...

Asked by shafi ahmed

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:
Last query:
Last reply:
Revision history for this message
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.

Revision history for this message
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

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

What is the output of:

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

Thanks

Revision history for this message
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