martedì 11 gennaio 2011

Install JDK 6 update 23 in Ubuntu 10.10




JDK (Java Development Kit) is a software that provides development tools for creating Java programs.

Installation


First we must download the package from the java website, select your platform, in our case Linux:



http://www.oracle.com/technetwork/java/javase/downloads/index.html

Here we go down the file "jdk-6u21-linux-i586.bin" to any folder, then leave where appropriate.

Now we have to give execute permissions:
sudo chmod +x jdk-6u23-linux-i586.bin

and install:
sudo ./jdk-6u23-linux-i586.bin

Now move the generated folder to a more appropriate directory:
sudo mv jdk1.6.0_23/ /usr/local

We set the new Java as one of the alternatives "java"
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/jdk1.6.0_23/bin/java" 1

Now we set the "new alternative" as real Java. This step makes the sun is the version used by default:
sudo update-alternatives --set java /usr/local/jdk1.6.0_23/bin/java

Now we do the same steps above for javac:

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/jdk1.6.0_23/bin/javac" 1
sudo update-alternatives --set javac /usr/local/jdk1.6.0_23/bin/javac



Now verify that everything works properly. Open the console and type:
java -version

If all is well, you should return the following:

java version "1.6.0_23"
Java (TM) SE Runtime Environment (build 1.6.0_23-B06)
Java HotSpot (TM) Client VM (build 17.0-b16, mixed mode, sharing)


For javac:
javac -version

If all is well back:
javac 1.6.0_23

If you have other installations of java / javac can be configured using the following commands:
sudo update-alternatives --config java
sudo update-alternatives --config javac


Also if you want setear JRE_HOME JAVA_HOME or as environment variables, we must go to:
sudo gedit /etc/environment

Here we record the routes where we have installed Java, in our case is as follows:
JAVA_HOME = "/usr/local/jdk1.6.0_23/bin/" (add)
JRE_HOME = "/usr/local/jdk1.6.0_23/jre" (add)
PATH ="...(other routes):$JAVA_HOME:$JRE_HOME (edit)


With this we finish the installation.

42 commenti:

  1. Il problema e' che conviene usare i repo di Ubuntu. In questa guida te installi la JDK 6 update 21. Da repo, abilitando il repository "Canonical Partner", installa la update 22, mentre l'attuale versione presente sul sito e' la update 23.
    Non che questa guida sia sbagliata, ma con riferimenti cosi' assoluti ai download ti trovi che installerai sempre la 21 (finche' non salta il link o finche' non aggiorni la guida :) ), mentre usando i repo ufficiali "insegui" la versione quasi attuale.
    E poi te mi installi solo la 32 bit mannaggia... Esiste anche la versione per Linux x64...

    RispondiElimina
  2. Ma cosa cambia beppe??? :) segui la stessa guida per le versioni nuove che usciranno!!

    RispondiElimina
  3. seguí las instrucciones y todo salió a la perfección, aun y cuando instalé la version 24

    RispondiElimina
  4. Is it needed to download JDK? Isn't better to download just JRE?

    RispondiElimina
  5. If you are doing any Java or Java Server Pages (JSP) development then you probably want the JDK. If you are just needing to support plugins or applets, then the JRE is probably sufficient.

    RispondiElimina
  6. thx man you are my saver!

    RispondiElimina
  7. MUST BE!
    JAVA_HOME="/usr/local/jdk1.6.0_23"

    RispondiElimina
  8. ...and
    PATH=$JAVA_HOME/bin:$PATH

    RispondiElimina
  9. search engine optimization companyIn Ear Hearing AidHey I'm Danielle, i was wondering if you could check out my groups blog spot for my class and if you could please follow us too. love your page by

    RispondiElimina
  10. thank you for the instructions... worked perfectly ...

    RispondiElimina
  11. I am going to install java JDK on my ubuntu PC, thank you so much for helping to install this.

    RispondiElimina
  12. I followed instructions from a stackoverflow discussion which seemed to have fewer steps to install JDK6 on ubuntu 10.04 .. here is what I did. not sure if this has any negative affects..

    1. sudo apt-get install python-software-properties

    2. sudo add-apt-repository ppa:sun-java-community-team/sun-java6

    3. sudo apt-get update

    4. sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk

    RispondiElimina
  13. This is a good tutorial. Short, to the point, and works. Thanks!

    RispondiElimina
  14. Show de bola... mui grato!!

    RispondiElimina
  15. Nice Blog. This blog is very interesting and you are provide best information for users. I always visited your blog site.Thanks for your wonderful sharing .

    liferay development and liferay portal

    RispondiElimina
  16. thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..thank you..really helpful

    RispondiElimina
  17. Grazie mille da Danimarca!

    RispondiElimina
  18. I have study your website and I got very useful and experienced details from your website. It’s really a very awesome content. You have done an excellent job. Thank you so much for discussing about java development kit.

    RispondiElimina
  19. It works with me using ubuntu unity 12.04. Thanks a lot.

    RispondiElimina
  20. Thanks for the post. You should take part in a contest for one of the best blogs on the web. I will recommend this site got information ofonline job portalIt’s hard to find knowledgeable online job portalbut you sound like you know what you’re talking about! Thanks for sharing this with others.

    RispondiElimina
  21. I am always searching for informative information like this. Thanks for sharing with us........ by OPS 571 Final Exam provider.

    RispondiElimina
  22. Iam really glad that I have gone through a great post.keep posting these type of Articles which would be useful for
    everyone...please visit our website for more info:
    MGT 498 Week 1

    RispondiElimina
  23. It’s really a very awesome content. You have done an very good job. express gratitude you so much for discussing the installation.by MGT 311 Final Exam

    RispondiElimina
  24. The blog is absolutely fantastic. Lots of great information and inspiration, both of which we all need.Thank a lot for sharing such all this....by ETH 316 Week 5 Individual Assignment provider



    RispondiElimina
  25. Great content i would be glad if you still post these type of Articles so that i can gain lot of information.For more information please go through
    MGT 498 Week 4

    RispondiElimina
  26. Great resourses.I really appreciate for posting such a great Article.it could be the better if you still have additional stuff...by ETH 316 Final provider



    RispondiElimina
  27. Nice Blog. This blog is actual absorbing and you are accommodate best advice for users. I consistently visited your blog site.Thanks for your admirable administration .by LDR 531 Week 3 Assignment

    RispondiElimina
  28. I have been looking the World Wide Web for this information and I want to thank you for this post. It’s not easy to find such perfectly written information on this topic. Great Work!pheonix property management

    RispondiElimina
  29. The first thing is that you have to plan your time. It means that you have to share your study load on all of the months of the semester. When doing so you have already acquired the required knowledge before the exam day approaches....for more information you can also go through
    MGT 498

    RispondiElimina
  30. The blog is actually fantastic. Lots of abundant advice and inspiration, both of which we all need.Thank a lot for administration such all this... by ETH 316 Week 3 Idividual Assignment provider

    RispondiElimina
  31. Nice Blog. This blog is actual absorbing and you are accommodate best advice for users. I consistently visited your blog site.Thanks for your admirable administration .... by ETH 316 Week 5 Idividual Assignment provider

    RispondiElimina
  32. The blog is actually fantastic. Lots of abundant advice and inspiration, both of which we all need.Thank a lot for administration such all this....by
    MGT 420 Week 2 provider.

    RispondiElimina
  33. Thank you so much for providing this valuable information. It is very important to us. You Posted a Good Stuff... by MGT 521 provider


    RispondiElimina
  34. This article is really fantastic and thanks for sharing the valuable post.
    Signature:
    download descarga facebook gratis para Android celular and download free descargar facebook gratis and descargar facebook gratis , descarga facebook

    RispondiElimina