This brief tutorial is going to show you how to manually install Oracle Java JDK 8, which was just recently released in Ubuntu. This method will show you how to download the package from its download page and install it in Ubuntu without using external PPAs or third party sources.
This method doesn’t depend on third-party repository. You download it directly from Oracle’s download page and install in Ubuntu.
JDK 8 is a major release and the latest which features a new language called Lambda Expressions “enables you to treat functionality as a method argument, or code as date”
Also released with this version are collection of classes in the new java.util.stream package that provide a Stream API to support functional-style operations.
For more about this release, please visit the release page @ http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html
To get started with downloading and installing Java JDK8 in Ubuntu, visit the download page and get the latest version from there. You can to download the 32-bit or 64-bit version for you Ubuntu machine.
Here’s download page http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
You must accept the license agreement before downloading.
When you download the file, choose to save it. By default Firefox saves it downloads in the ~/Downloads folder in Ubuntu.
Next, open the terminal and run the commands below to extract the downloaded file.
tar -xvf ~/Downloads/jdk-8-linux-x64.tar.gz
Then run the commands below to create a folder for Java JDK 8 files in the /usr/lib directory.
sudo mkdir -p /usr/lib/jvm/jdk1.8.0/
Then run the commands below to move JDK content to the new folder.
sudo mv jdk1.8.0/* /usr/lib/jvm/jdk1.8.0/
Next, run the commands below to begin configuring Java
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1
Then copy and paste the line below enable Javac module
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1
Finally, copy and paste the commands below to complete the installation.
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws" 1
To verify if Java is fully installed, run the commands below to test it.
java –version
Enjoy!
Frequently Asked Questions
How to manually install Oracle Java JDK 8 in Ubuntu without using external PPAs?
To manually install Oracle Java JDK 8 in Ubuntu without using external PPAs, you can download the package directly from Oracle's download page and follow the installation steps provided in the article.
What are the new features in Oracle Java JDK 8?
Oracle Java JDK 8 introduces new features such as Lambda Expressions, which allow you to treat functionality as a method argument, and the java.util.stream package that provides a Stream API for functional-style operations.
Where can I find the download page for Oracle Java JDK 8 for Ubuntu?
You can find the download page for Oracle Java JDK 8 for Ubuntu at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. Make sure to accept the license agreement before downloading.
What are the steps to extract the downloaded Oracle Java JDK 8 file in Ubuntu?
To extract the downloaded Oracle Java JDK 8 file in Ubuntu, open the terminal and run the command 'tar -xvf ~/Downloads/jdk-8-linux-x64.tar.gz'. This will extract the contents of the file.
How do I create a folder for Java JDK 8 files in Ubuntu?
To create a folder for Java JDK 8 files in Ubuntu, run the command 'sudo mkdir -p /usr/lib/jvm/jdk1.8.0/'. This will create a directory where you can move the JDK content.
What command is used to move JDK content to a new folder in Ubuntu?
To move JDK content to a new folder in Ubuntu, you can use the command 'sudo mv jdk1.8.0/* /usr/lib/jvm/jdk1.8.0/'. This command moves the JDK files to the specified directory.
How to configure Java in Ubuntu after installing Oracle Java JDK 8?
To configure Java in Ubuntu after installing Oracle Java JDK 8, run the command 'sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1'. This sets up Java as an alternative for the system.
What is the command to enable the Javac module after installing Oracle Java JDK 8?
To enable the Javac module after installing Oracle Java JDK 8, copy and paste the command 'sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1'. This command sets up Javac as an alternative for the system.