I am trying to install Java 8 on Ubuntu. Due to restrictions on download at my work place, I cannot install using apt-get. Hence, I downloaded the archive from Oracle's website, named jdk-8u25-linux-x64.gz. However, when I extracted it, there was only a file inside it, named jdk-8u25-linux-x64. How to install using that file?
2 Answers
These are the installation instructions for Java SE Development Kit 8u25 (jdk-8u25-linux-x64.tar.gz) which I copied from the Oracle website. This isn't really an answer, it's a long comment to demonstrate that the question is indeed a duplicate of How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE?.
Installation of the 64-bit JDK on Linux Platforms
This procedure installs the Java Development Kit (JDK) for 64-bit Linux, using an archive binary file (.tar.gz).
These instructions use the following file:
jdk-8u25-linux-x64.tar.gz
Download the file.
Before the file can be downloaded, you must accept the license agreement. The archive binary can be installed by anyone (not only root users), in any location that you can write to. However, only the root user can install the JDK into the system location.
Change directory to the location where you would like the JDK to be installed, then move the .tar.gz archive binary to the current directory.
Unpack the tarball and install the JDK.
tar zxvf jdk-8u25-linux-x64.tar.gz
The Java Development Kit files are installed in a directory called jdk1.8.0_version in the current directory.
Delete the .tar.gz file if you want to save disk space.
The only change that I made from the source is to change the name of the file to the name of the file that was downloaded in the question. Is it OK to do this? Yes indeed. See the Oracle documentation: Installation Instructions Notation and Files.
As it turns out, you shouldn't rely on ubuntu's archive manager. Extracting using command line works just fine.
-
Ubuntu's Archive Manager works OK too, if you put a check mark in the checkbox under the Actions heading in the Archive Manager Extract window to the left of where it says: Keep directory structure.– karelNov 25, 2014 at 16:47