Java installation - Storm Streaming Server

If you wish to install Storm Streaming Server directly on your machine of VPS, a Java Virtual Machine (JVM) is required. This guide describes in details how to download and configure Java on Linux (Debian-based distributions), Windows and Mac OS. Once this part is done, please check our Server installation guide to see how to properly install and configure our server software.

In order to check whether your server comes with a pre-installed Java library, you can use the following command.

For Linux and Mac-OS X based systems (terminal)

                                
java -version
                            

For Windows based systems (terminal)

                                
java -version
                            

In return, you should get something like this:

                                
java version "13.0.1" 2019-10-15
Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
                            

If java is not present in your system, you will be informed that such command does not exist

                                
-bash: java: command not found
                            

Installation of Java OpenJDK-JRE

  1. Linux-based systems

    For Debian-based Linux distribution (like Ubuntu, Mint)

                                    
    sudo apt-get update
    sudo apt-get install java-1.8.0-openjdk
                                

    For Fedora, Oracle, Red-Hat

                                    
    su -c "yum install java-1.8.0-openjdk"
                                

    Certain versions of Debian, Fedora, etc. are limited to a specific version of Java. It is also possible to download the latest Java JRE on your own from https://jdk.java.net. Once the files are uploaded to your server, extract the package:

                                    
    tar xvf openjdk-<VERSION>_bin.tar.gz -C /usr/lib/jvm/java-<VERSION>
                                
    Depending on your Linux distribution these paths might not be present on your system. Command mkdir and chown will allow you to create them.

    Where <VERSION> is the actual version of the JVM, e.g., “16+36_linux-x64”. You’ll also have to add a reference to this Java version using:

                                    
    sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-<VERSION> /bin/javac" 1
                                
    As in previous note, depending on your Linux distribution these paths might not be present on your system.

    followed by:

                                    
    sudo update-alternatives --config java
                                

    At this point, you’ll be asked to select your default java configuration. Your newly installed JRE should appear as the last one on the list. Select the number next to the path to confirm your choice.

                                    
    $ sudo update-alternatives --config java
    There are 2 choices for the alternative java (providing /usr/bin/java).
    
      Selection    Path                                      Priority   Status
    ------------------------------------------------------------
    * 0            /usr/lib/jvm/java-6.31-oracle/bin/java     1062      auto mode
      1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
      2            /usr/lib/jvm/java-6.31-oracle/bin/java     1062      manual mode
    
    Press enter to keep the current choice[*], or type selection number:
                                
  2. Windows-based systems

    Library files can be found on https://jdk.java.net. Once the package is downloaded, please extract it to C:\Program Files\Java\jdk-<VERSION>, where <VERSION> is the actual version of the library.

    Now we’ll have to set the proper PATH for you Java. Select Control Panel and then System. Click Advanced and then Environment Variables and add the location of the bin folder of the JDK installation to the PATH variable in System Variables.

    The following is a typical value for the PATH variable:

                                    
    C:\WINDOWS\system32;C:\WINDOWS;"C:\Program Files\Java\jdk-<VERSION>\bin"
                                

    Now it’s time for JAVA_HOME

    In the same window, under System Variables, click New. Enter the variable name as JAVA_HOME. Then enter the variable value as the installation path of the JDK (without the bin sub-folder).

    JAVA_HOMEC:\Program Files\Java\jdk-<VERSION>

    Click OK / Click Apply Changes.

  3. Mac OS X based systems

    We suggest installing OpenJDK-JRE via Homebrew software. Before you start, make sure to install https://brew.sh.

    Homebrew works in a very similar way to APT-GET known from Debian. First, open a terminal window.

                                    
    brew update
    brew install java
                                

    You can also install a specific version of Java

                                    
    brew install --cask adoptopenjdk15
                                

Installation of Oracle Java JRE

  1. Linux-based systems

    The installation of Oracle Java on Linux-based systems is very similar. Please download the latest JRE from https://www.oracle.com/pl/java/technologies/javase-downloads.html

    Once the package is downloaded, please move it to a write-enabled directory. Now we’ll be able to use some commands.

                                    
    sudo apt install <PATH_TO_FILE>/jdk-<VERSION>_bin.deb
                                

    The installer will ask several questions and ask you to accept the license. Once the process is finished, we must configure this JRE as the default one:

                                    
    sudo update-alternatives -install /usr/bin/java java /usr/lib/jvm/<VERSION> 1
                                

    In case you already have a different version of java, so you can choose the right one with:

                                    
    sudo update-alternatives --config java
                                

    Your newly installed JRE should appear as the last one on the list. Select the number next to the path to confirm your choice.

                                    
    $ sudo update-alternatives --config java
    There are 2 choices for the alternative java (providing /usr/bin/java).
    
      Selection    Path                                      Priority   Status
    ------------------------------------------------------------
    * 0            /usr/lib/jvm/java-6.31-oracle/bin/java     1062      auto mode
      1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
      2            /usr/lib/jvm/java-6.31-oracle/bin/java     1062      manual mode
    
    Press enter to keep the current choice[*], or type selection number:
                                

    In order to check if everything is ok, please use the following command:

                                        
    sudo java -version
                                

    If the output says that command was not found, there is one more command we need to do:

                                        
    export PATH=$PATH:/usr/lib/jvm/jdk-<VERSION>/bin
                                
  2. Windows-based system

    Thanks to the automated installer, this process is very simple. Just grab the latest version from https://www.oracle.com/pl/java/technologies/javase-downloads.html and start the installer.

  3. Mac OS X

    The installation process looks the same as on Windows. Just go to https://www.oracle.com/pl/java/technologies/javase-downloads.html, grab the installer and start the installation process.