Ubuntu – Update install JAVA SE developement kit 8(JDK)8 ubuntu 32 bit

androidandroid-studiojavajdkupdates

I was trying to update the JDK on my machine (Ubuntu 14) by downloading the packages on Java official site (this one http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html )

Now this was in order to install android studio, following the instructions on this page https://developer.android.com/studio/install.html

I did what they tell to do, but I encountered 3 problems:
– First, why is there no 32 bit package downloadable? And can I download the 64 anyway and it works (I mean probably not, but the 32 bit is just not existing….)
– Second, I didn’t saw any bash/python file to """install""" the package, so is there a special folder to put it or the home will do?
-Third, all started because my javac -version gave 1.7 as a result (1.8 is needed), but after downloading the package and doing what they do the commands STILL gives version 1.7, which is mainly why I ask this question…

I apologize for my english and my gnu-ignorance, hoping someone has an answer 🙂

SIDE NOTE: android studio actually blocks with this mistake (JDK8 is needed, I have 7. So the update is not completed)

Ok i found HowTo: Upgrade java on Ubuntu 14.04 LTS? this, but…..is there a way that does not rely on official tar downloads? Plus, even though os says java is version 1.8, androidstudio says it's 1.7

Best Answer

I'll try to answer all your questions, but please break them into separate Q&As in the future. It makes it easier for one person to answer.

  1. You seem to have a bit of a misunderstanding in regards to 32-bit. x86 is actually 32-bit. x86 is named after a line of old Intel CPUs (I think), but they didn't really have anything to name 64-bit after, so it became x64.

    • Get the x86 version
  2. You'll have to adapt the file names a bit, since Java versions have changed, but this Ask Ubuntu Q&A has very extensive installation instructions: How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE?.

  3. As for default Java version, you need to have the one you want as default installed, and then you need to select it as the default. How to set default Java version?.

    • The command you want, since it looks like you're dealing with javac, is:

      sudo update-alternatives --config javac
      
    • Replacing javac with java will allow you to change defaults there too.

Honestly, I'm having a hard time understanding your question fully, and I see you don't speak English natively. Hopefully, what I have below will make the whole thing easier.

There's an alternative to Oracle's JDK, called OpenJDK. It's a very simple installation, and I believe it sets itself as the default Java version. To install:

sudo apt-get install openjdk-8-jdk