How to install the JDK on Ubuntu 17.04

java logo

Installing Java in our Ubuntu is quite easy. This introduces the java interpreter to our operating system. But if we want to program in Java or simply compile code in this programming language, we will need Java tools to do it.

We will find this in the developer kit that exists or also known as JDK. The Java JDK can be installed easily, like the interpreter, but we will need to make some changes for the system to recognize the JDK as the main package.

First we have to install the JDK in our distribution. To do this, we open a terminal and write the following:

sudo apt-get install openjdk-8-jdk

How to configure the JDK in our Ubuntu 17.04

This will install the free version of Java in version 8. A fully compatible JDK and more free than the original version of Oracle. Once we have installed the JDK, we have to tell the system that we have a JDK and that it has to use it every time we compile or need the Java Development Kit. To do this we open the terminal and write:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk

And now we write in the terminal the following line to change the path of the system, causing many compilation problems to be solved.

export PATH=$PATH:/usr/lib/jvm/java-8-openjdk/bin

After this, all the Java-related configurations are done and we will have perfectly the Java development kit, which will allow us to compile and create applications in Java. Still, it exists an option that will allow us to know if the JDK is installed correctly. To do this, we open the terminal and write the following:

javac -version

After this, the terminal will show us the version of Java that we have installed in Ubuntu as well as the JDK that is in the system. The process is very simple, but you must not forget the configuration steps, since most of the problems appear due to these configurations.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Abigail said

    Another matter of the procedure in order to provide cellulite with exercises, therefore not only
    some indestramento. https://mycmdline.wordpress.com/2010/02/18/cursos-de-php-y-mysql-gratis/

  2.   Angel said

    Hello, I have done what you have indicated in the tutorial. Now once installed, how can I open JDK? I can't find the executable file or way to do it, despite having installed the folders and files in lib / jvm.

    See if you can give me a hand.

    Thank you.

    Greetings.

    1.    erick said

      Hello brother, what happens is that as such it does not bring with it a graphical environment like netbeans or eclipse, from the console you can compile your programs with javac programname.java and once compiled you run it with java programname without the .java or since you have installed The jdk you can install an environment like the one mentioned, for example you can install eclipse and then when you install you indicate where your jdk is installed, I hope I have helped you, a greeting and a hug.

  3.   Mrscary said

    excellent explanation! Thanks a lot!

  4.   brayanhack said

    from the first time I installed ubuntu I liked everything about linux and I would like to program in linux it is desir to program apps and games for linux