How to install java 7 from 6

Asked by Sukhendu Ghosal

I have installed libre office base. Which installed the open-jdk JAVA 6 runtime (openjdk-6-jre) autometically . Now I want to install latest java open jdk 7. How to install 7 (replacing java 6) ? I want to remove java 6 completely but not the office base. How to to do that ? I want libre office base & java 7. is it possible ??
thanks..

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openjdk-7 Edit question
Assignee:
No assignee Edit question
Solved by:
Sam_
Solved:
Last query:
Last reply:
Revision history for this message
Sasa Paporovic (melchiaros) said :
#1

I suggest to do :

sudo apt-get install openjdk-7-jdk openjdk-7-source openjdk-7-demo openjdk-7-doc openjdk-7-jre-headless openjdk-7-jre-lib

Make an internetsearch of "Ubuntu openjdk7" you will find detailed instructions.

After this you have to set openjdk7 as default:

http://askubuntu.com/questions/64329/how-to-replace-openjdk-6-with-openjdk-7

do not do the step with purging opnejdk6.

I have not observed problems with libre office on my system.

Please close this here as solved.

Revision history for this message
Sasa Paporovic (melchiaros) said :
#2

You do not have to import an ppa if you are on Ubuntu12.04. The packages are available directly from the default repositories.

Revision history for this message
Sam_ (and-sam) said :
#3

> remove java 6 completely but not the office base

Java and libreoffice are independent from each other, it's possible to run libreoffice without any java installed at all, it's also possible to deactivate an installed java in libreoffice preferences.

It's possible to run different java versions side by side and selecting the preferred one with the alternate cmd.
https://help.ubuntu.com/community/Java#Choosing_the_default_Java_to_use

To remove packages completely there is for example the 'apt-get purge <package>' and 'apt-get autoremove' available.
https://help.ubuntu.com/community/AptGet/Howto

e.g. for 12.04
apt-get purge openjdk-6-jre
apt-get autoremove

apt-get install openjdk-7-jre

Revision history for this message
Sukhendu Ghosal (sukhendughosal) said :
#4

Just look at my terminal output with "sudo apt-get purge openjdk-6-jre". Is there java seven already installed ?? What is going to download ? Why I have to download 59 MB to remove a package ?? please help

roco@Inspiron-1440:~$ sudo apt-get purge openjdk-6-jre
[sudo] password for roco:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  gcj-4.6-base gcj-4.6-jre gcj-4.6-jre-headless gcj-4.6-jre-lib gcj-jre gcj-jre-headless icedtea-7-jre-cacao
  icedtea-7-jre-jamvm libgcj-common libgcj12 libgcj12-awt openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib
Suggested packages:
  fastjar gcj-4.6-jdk gcj-jdk libgcj12-dbg icedtea6-plugin sun-java6-fonts fonts-ipafont-gothic fonts-ipafont-mincho
  ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts ttf-bengali-fonts
The following packages will be REMOVED:
  default-jre* icedtea-netx* openjdk-6-jre*
The following NEW packages will be installed:
  gcj-4.6-base gcj-4.6-jre gcj-4.6-jre-headless gcj-4.6-jre-lib gcj-jre gcj-jre-headless icedtea-7-jre-cacao
  icedtea-7-jre-jamvm libgcj-common libgcj12 libgcj12-awt openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib
0 upgraded, 14 newly installed, 3 to remove and 0 not upgraded.
Need to get 59.0 MB of archives.
After this operation, 155 MB of additional disk space will be used.
Do you want to continue [Y/n]?

thnka

Revision history for this message
Best Sam_ (and-sam) said :
#5

> Why I have to download 59 MB

The other packages are the result when you issued the suggested cmds of #1 which incl. sources, demo and doc packages.
If you need all those fine, if not then don't install them, only install openjdk-7-jre as suggested in #3 and apt will do the rest.

Revision history for this message
Sukhendu Ghosal (sukhendughosal) said :
#6

Thanks Sam_, that solved my question.