Java Development Kit also known as JDK is important when compiling Java applications including Apache Maven, Apache Ant, Eclipse and intelli J IDEA. If you want to install JDK in your system, the first thing that comes to your mind is spending money to pay for the service. However, you can do it and all you need is know how to do it. To install JDK on Ubuntu, and you follow the steps below:
- Check and see if your operating Ubuntu Linux system architecture is 32-bit or 64-bit, you should then open a terminal and enter the appropriate command.
- Check if you have Java installed on your system. To do this, you will have to run the Java version command from terminal. Open a terminal and enter the appropriate command.
- Completely remove the Open JDK from your system and create a directory to hold your Java JDK binaries.
- Download Oracle Java JDK for your Linux. Take time to confirm that you choose the right binaries for the system.
64-bit Java binaries never work with 32-bit Ubuntu Linux operating systems, it gives many messages.
- Copy the Java binaries into the /usr/loca/java/ directory. In most cases the Oracle Java binaries are downloaded.
- Unpack the compressed Java binaries in the directory /usr/loca/java
- Double check your directories. Here you should have two binary directories which are not compressed.
- Edit the system PATH file /etc/profile and then add the appropriate system variables.
- Scroll down up to the end of the file using your arrow keys and then enter the necessary commands.
- Save the/etc/profile file and then exit
- Inform your Ubuntu Linux system where you have located your Oracle Java JDK.
- Inform your Ubuntu Linux system that you have set Oracle Java JDK as your default.
- Reload your system wide PATH/etc/profile.
- Check to see if the Oracle Java is properly installed correctly on your system.
- You have now installed JDK on Ubuntu. Reboot your Ubuntu Linux system. Afterwards your system will be fully validated for running smoothly and developing java programs.
Once you have successfully install the JDK on Ubuntu, you should receive a confirmation message which displays javac 22.214.171.124.0.Installing JDK on Ubuntu is a great idea because it will really help you compile your Java application and will lessen your work a lot.