I'm not familiar with Linux at all, but I have to tell my students that may use it how to install Java.
As a Windows user, I simply download it from JDK downloads page and then install it with the wizard. However, I only found tutorials with apt-get, that is obviously different from my way.
Is it a similar way to install Java through website, not through shell? I see that I can download .tar.gz archive. Can I then unarchive it and install it with some kind of wizard like in Windows? I need that JDK only for IntelliJ IDEA, so it is not necessary to install public JRE and JAVA_HOME.

  • Wouldn't it be enough to just extract it? Which can be done with: tar -zxvf *.tar.gz – Mikael Kjær Sep 4 '17 at 9:54
  • @MikaelKjær, so after the extraction I will have installed JDK? It's like portable? I thought that I will have an installator after extraction. – Feeco Sep 4 '17 at 10:05
  • No. It's portable in the sense you can just run the binary to use it. – Mikael Kjær Sep 4 '17 at 10:06
  • 1
    Installing using apt-get is the preferred way on Ubuntu, so if they use that OS, they probably know how to (find out how to) install Java on Ubuntu using apt-get. Providing them with a Windows-like installation will be totally useless for them. – John Stoneman Sep 4 '17 at 10:28
up vote 0 down vote accepted

Linux is a lot easier to use than you think(*). On any desktop distribution there is a Software Manager GUI (actual name depends on distribution/desktop manager), in which you can search "Java" and install it in a few clicks.

On Linux, it is best to install Java through the standard software packages, because it makes it easier to install several versions and to switch between them.

(*) When it comes to software installation/management, it is light-years ahead of Windows.

  1. Download it

Go to http://java.com and click on the Download button and get the tar.gz file. Don't forget to check the download file size to ensure that you have downloaded the full, uncorrupted. You can use wget if you you're not in GUI mode.

  1. Install it

    • Change to the directory in which you want to install. Type: cd you_directory_path_name (example: to install the software in the /usr/java/ directory, Type: cd /usr/java/)
    • Move the .tar.gz archive binary to the current directory. Unpack the .tar and install Java

    tar zxvf jre-XuXX-linux-i586.tar.gz

    • The Java files are installed in a directory called jre1.X.X_XX in the current directory (X is version depednet).
    • Delete the .tar.gz file if you don't want to keep it.
  • He asked to install Java 'not through shell'. – John Stoneman Sep 4 '17 at 10:29
  • You can always click instead of shelling. – Overmind Sep 4 '17 at 10:36
  • @John_Stoneman then his title should be more precise. – jiggunjer Sep 4 '17 at 10:55
  • @jiggunjer, I really asked about "wizard" installation, but as I can see it's not possible. Now I'm installing Ubuntu and will try to do this. If more convenient answer will be added, I will gladly accept it. – Feeco Sep 4 '17 at 11:39
  • Software centre doesn't have a Java package? That's like a wizard. But it also uses apt-get. So the question is imprecise. – jiggunjer Sep 4 '17 at 12:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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