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.

I am new to java and I installed JDk 7 using

sudo apt-get install openjdk-7-jre

But when I do java -version I get this

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

How do I set it to 1.7 and also how do I set my compiler to 1.7 in eclipse?

share|improve this question

1 Answer 1

You may use the following command to change the default java version: sudo update-alternatives --config java

I think eclipse will use the default java version, but you may take a look at "Window -> Preferences -> Java -> Compiler"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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