Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to install Java?
How to replace OpenJDK 6 with OpenJDK 7?

I've installed Java in Ubuntu and generally it seems to be ok, but now I'm trying to upgrade to OpenJDk 7 and finding problems. When I do which java I get the following...

epic@ubuntu:~/git/game-of-life$ which java
/usr/bin/java
epic@ubuntu:~/git/game-of-life$ cd usr/bin/java
bash: cd: usr/bin/java: No such file or directory
epic@ubuntu:~/git/game-of-life$ 

When I do java -version it tells me it's

epic@ubuntu:~/git/game-of-life$ java -version
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.1)
OpenJDK Client VM (build 20.0-b11, mixed mode, sharing)
epic@ubuntu:~/git/game-of-life$ 

If I look in the Ubuntu Software Center, it thinks both 6 and 7 OpenJDK are installed, any ideas?

EDIT : just realised I added..

export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.3 export M2=$M2_HOME/bin export PATH=$M2:$PATH export JAVA_HOME=/usr/local/jdk1.6.25

to my .bashrc - should I keep doing it this way or would it be bad practice to link like this?

Thanks,

share|improve this question
    
You cannot cd to the java binary, you can - however - do cd /usr/bin. Be prepared to follow quite a bit of symbolic links. –  Thorbjørn Ravn Andersen Feb 1 '12 at 11:41
add comment

marked as duplicate by fossfreedom, Bruno Pereira, Jorge Castro, Takkat, jrg Feb 3 '12 at 0:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Hi I used this when I installed jdk 7 http://www.byteality.ch/blog/?p=288 You have to use update-alternatives to set your default java version to use.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.