Skip to content
Snippets Groups Projects
Select Git revision
  • master default
  • maven-setup
  • lectures2021
  • lectures2020
  • antipatterns
  • issue-11-allow-user-to-enter-and-update-metadata-about-the-latlong-points
  • 8-add-pdf-export
  • issue-10-display-latlong-metadata-in-the-fx-ui
  • issue-9-LatLong-meta-data
  • 9-meta-informasjon-knyttet-til-latlong-objekter
  • issue-6-rest-api
  • feature/update-gitignore
  • lectures-2024
  • lectures-2021
  • 2019_materials
15 results

get-java.md

Blame
  • Setting up Java

    To be able to develop in Java one requires a JDK - Java Development Kit. You have to download and properly set up java For IT1901 either JDK 11 or 12 will do just fine.

    Install java

    If there is no Java Development Kit installed or the version is not what you need (we recommend version 11 or 12) then proceed to download JDK and install it.

    Windows

    Check if there is any java installed

    In a command line window type:

    java -version

    Extract downloaded binary

    After the download finishes you have in the destination folder the .zip file with a name like this openjdk-12.0.2_windows-x64_bin.zip. Right click it and extract the contents.

    Copy the extracted folder in a meaningful location on your hard drive like for example in C:\jdks

    Set up the environment variables

    To properly set up Java on your machine you need to set couple environment variables. To do that you need to open "Environment variables" dialog box. There are several ways to get to that dialog box.

    Right click "This PC" and select "Properties"

    You should see a window like the one below. Choose "Advanced System Settings" option in the top left side.

    A new window will open showing "System properties"

    Open "Environment Variables"

    If the JDK should be available for all users than make the environment variable changes at system level otherwise do them at user level.

    Check if there is already a JAVA_HOME environment variable. If it is change the value to the path to your JDK (C:\jdks\jdk-12.0.2)

    Next we need to add the bin folder within the JDK folder to the PATH environment variable so that the java commands are accessible from the command prompt

    Finally we can check if java is now running as expected

    Notes
    • You can check the values of environment variables from command prompt issuing commands such as SET JAVA_HOME or SET PATH
    • You can get to the environment variable dialog by other means ** search "env" in the windows start menu ** open System from the Control Panel and then "Environment Variables"

    Linux

    Check if there is any java installed

    Open a terminal window and type

    java -version

    MacOs

    Check if there is any java installed

    Open a terminal window and type

    java -version

    Download Java

    Open-source reference implementation (GNU GPL License, provided by Oracle)

      1. select the general available build (currently 12)

      1. download the binary corresponding to your operating system

    Get binaries from Oracle site (Oracle license)

    1. go to https://www.oracle.com/technetwork/java/javase/downloads/index.html
    2. sign in (if you do not have an account you will need to create one in order to be allowed to download)
    3. select the latest (currently 12)
    4. download the binary corresponding to your operating system

    There are more choices for downloads. Typically a .zip or .tar.gz would imply manual setup while the .exe, .deb, .rpm, .dmg will provide some sort of installer support.