Install Java SE

Java SE is required for running OpenMRS applications and developing OpenMRS modules. Java SE 8 is used as an example for this instruction.

Install Java SE 8 on Windows 10

Note: The instructions are for the Windows 64 bit system. If your Windows system is 32bit, download and install the 32-bit version of the JDK.

  1. If you have another version of Java SE installed, uninstall it, and delete the system environment variables that are related to JDK and JRE.

  2. To create an Oracle account, follow the create account link.

  3. Download Java SE 8 .

    1.  Go to the Oracle Java downloads site

    2. Click on the Windows header and then the click on the download link labelled x64 installer

    3. A pop-up will appear. In the popup, select the checkbox labeled I reviewed and accept the Oracle Technology Network License Agreement for Oracle Java SE, then click on the download button.

    4. The Oracle account sign in window opens. Sign in to your Oracle account. The download should now start.

  4. To install Java SE 8,  double click the downloaded executable file file.

  5.  When the installation is complete, verify that both JRE and JDK are configured correctly.

    1. Open a command line window.

    2. At the command prompt, enter java -version, you should see output like the following (note that your version might differ):

      Java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)

       

  6.  At the command prompt, enter javac -version, you should see output like the following (note that your version might differ):

    Javac 1.8.0_261

     

If you do not see the expected output, make sure your system environment variables for java are set up correctly. For more information, see the link below.
https://www.codejava.net/java-core/how-to-set-java-home-environment-variable-on-windows-10

Install Java SE 8 on Ubuntu

To install Java SE 8 on Ubuntu, follow these steps:

  1. Run the update package command:

    sudo apt-get update

     

  2. Install the OpenJDK on it's own as a package using this command:

     

  3. To test the installation, type java -version, you should see the following output: