• How to manually install and troubleshoot Java on your Wowza media server

    Wowza Streaming Engine™ is a powerful Java server. When you install Wowza Streaming Engine 4.2.0 and later, the install wizard automatically installs a server version of the Java Runtime Environment (JRE) that it requires, making it easy to get your media server up and running. If you can't or don't want to use the version of Java that installs with Wowza Streaming Engine, however, you can use a different JRE. This article explains how to install and use a different version of Java from what's installed automatically. It also explains how to determine and control which version of Java is being used by your operating system and Wowza Streaming Engine, and offers some basic troubleshooting steps for problems that may arise.

    Notes:
    • Java installs automatically with Wowza Streaming Engine 4.2.0 and later. This reduces complications and the risk of potential problems. Other JREs are untested for support with Streaming Engine 4.2.0 and later, and using any JRE other than what installs with Streaming Engine isn't recommended.

    • Wowza Streaming Engine is automatically tuned to take best advantage of available hardware resources when the server starts. The server calculates an appropriate Java heap size, garbage collection settings, and other Java command-line options, but you can adjust many of the Java performance settings if desired. For details, see Java Settings in the "Performance tuning" article.

    Contents


    About Wowza Streaming Engine and Java
    Determine which version of Java your Wowza Streaming Engine Server is using
    Download and install Java
    Instruct Wowza Streaming Engine Server to use a specific version of Java
    Troubleshooting

    About Wowza Streaming Engine and Java


    Wowza Streaming Engine requires the installation of a Java Runtime Environment (JRE) that supports deploying Java in a server environment. When you install Wowza Streaming Engine 4.2.0 or later, the install wizard automatically installs a server version of the JRE that Wowza Streaming Engine requires. Earlier versions of Wowza Streaming Engine and Wowza Media Server software, however, use the version of Java that the operating system uses.

    Wowza Streaming Engine supports Java 6, Java 7, and Java 8. Java 8 is recommended. The following Java packages can be used with Wowza Streaming Engine:

    • Java Development Kit (JDK). The JDK includes a complete JRE as well as tools for developing and debugging server-side applications.

    • Java Server JRE. The Server JRE is for deploying Java applications on servers. Install this package if you want to run Java programs, but not develop them.

    For optimal performance and to use Wowza Transcoder, you must deploy Wowza Streaming Engine on a 64-bit operating system with the latest 64-bit Java JDK or Server JRE.

    Determine which version of Java your Wowza Streaming Engine server is using


    In Wowza Streaming Engine Manager, you can see which version of Java is being used.

    • Click the Server tab and then click About in the contents panel.

      Streaming Engine Manager displays the Java Version, Java VM Version, Java Architecture, and other details about the Java version that it's using.


    Note: If you're using Wowza Media Server™ software, use Command Prompt or Terminal to determine which version of Java is being used: Open a Command Prompt window (Windows) or Terminal window (OS X/Linux) and enter the command java -version. Command Prompt or Terminal returns something like this:

    java version "1.8.0_05"
    Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
    Wowza Streaming Engine and Wowza Media Server software require Java version 1.6 or greater. If your Wowza server software isn't using a supported version, download and install the newest version of Java. See Download and install Java.

    Download and install Java


    1. Download the latest 64-bit Java JDK or Server JRE from the Java SE Downloads page.



      Note: The only time you should install a 32-bit version of Java is if you're running Wowza Streaming Engine or Wowza Media Server on a 32-bit Windows OS. In that case, download and install the 32-bit server version of the JDK.
    2. Follow the instructions to install your Java environment.

    3. Validate that your Wowza media server is using the new version. See Determine which version of Java your Wowza Streaming Engine Server is using.

    4. If your Wowza media server software isn't using the right version of Java, point it to a specific, supported version. See Instruct Wowza Streaming Engine Server to use a specific version of Java.

    Instruct Wowza Streaming Engine Server to use a specific version of Java


    Important: Wowza Streaming Engine 4.2.0 and later automatically install a supported version of Java. Other JREs are untested for support with the Streaming Engine software, and using any JRE other than what installs with Streaming Engine isn't recommended.

    Instruct Wowza Streaming Engine on Windows to use a specific version of Java

    On Windows, Wowza Streaming Engine 4.1.2 and earlier use the JAVA_HOME environment variable to determine which Java environment in which to run. If you have problems starting Wowza Streaming Engine on Windows, make sure that JAVA_HOME points to a Java 1.6 or greater Java environment. If you change or upgrade your Java environment and the installation path changes, be sure to update the JAVA_HOME variable to point to the new location. The JAVA_HOME environment variable should point to the base folder of the Java installation. The base folder is the folder that contains the bin folder.

    1. Click Start, click Control Panel, and then click System.

    2. Click Advanced system settings in the left column of the System Control Panel.



    3. On the Advanced tab of the System Properties dialog box, click the Environment Variables button.



    4. In the Environment Variables dialog box, in the System variables area, click JAVA_HOME, and then click Edit.



      Note: For Wowza Streaming Engine 4.2.0 and later, select and edit the WMSJAVA_HOME variable.
    5. Change the Variable value to the path of the new Java version.



      Note: Paths to C:\Program Files (x86)\Java point to a 32-bit version of Java. The path should point to a 64-bit version at C:\Program Files\Java.
    6. Click OK three times to save your changes and exit System Properties.

    Instruct Wowza Streaming Engine on OS X to use a specific version of Java

    Update the Wowza Streaming Engine symbolic link (symlink) to point to the specific version of Java.

    • For Wowza Streaming Engine 4.2.0 and later, update the symbolic link at /Library/WowzaStreamingEngine/java to point to the new Java version. For example, if the new Java version is installed at /usr/lib/jvm/jdk1.8.0_31, execute the following commands:

      rm -rf /Library/WowzaStreamingEngine/java
      ln -sf /usr/lib/jvm/jdk1.8.0_31/bin/java /Library/WowzaStreamingEngine/java


    • For Wowza Streaming Engine 4.1.2 and earlier, update the symbolic link at /usr/bin/java to point to the new Java version. For example, if the new Java version is installed at /usr/lib/jvm/jdk1.8.0_31, execute the following commands:

      rm -rf /usr/bin/java
      ln -sf /usr/lib/jvm/jdk1.8.0_31/bin/java /usr/bin/java

    Instruct Wowza Streaming Engine on Linux to use a specific version of Java

    Update the Wowza Streaming Engine symbolic link (symlink) to point to the specific version of Java.

    • For Wowza Streaming Engine 4.2.0 and later, update the symbolic link at /usr/local/WowzaStreamingEngine/java to point to the new Java version. For example, if the new Java version is installed at /usr/lib/jvm/jdk1.8.0_31, execute the following commands:

      rm -rf /usr/local/WowzaStreamingEngine/java
      ln -sf /usr/lib/jvm/jdk1.8.0_31/ /usr/local/WowzaStreamingEngine/java


    • For Wowza Streaming Engine 4.1.2 and earlier, update the symbolic link at /usr/bin/java to point to the new Java version. For example, if the new Java version is installed at /usr/lib/jvm/jdk1.8.0_31, execute the following commands:

      rm -rf /usr/bin/java
      ln -sf /usr/lib/jvm/jdk1.8.0_31/bin/java /usr/bin/java

    Troubleshooting


    Get Java installation details and start Streaming Engine in console mode

    If you run into problems when starting Wowza Streaming Engine or Wowza Media Server, use the following commands to print the Java variables and start the server in console mode. The information you print may provide clues about the problem and provide context to help troubleshoot your installation, and the startup command will get your Wowza media server software running.

    Windows 7 and Windows Server 2008


    • For Wowza Streaming Engine 4.2.0 and later, open a Command Prompt window and type:
      echo %WMSJAVA_HOME% 
      "%WMSJAVA_HOME%"\bin\java -version
      echo %WMSAPP_HOME%
      echo %WMSCONFIG_HOME%
      cd %WMSAPP_HOME%/bin
      startup.bat
    • For Wowza Streaming Engine 4.1.2 and earlier, open a Command Prompt window and type:
      echo %JAVA_HOME% 
      "%JAVA_HOME%"\bin\java -version
      echo %WMSAPP_HOME%
      echo %WMSCONFIG_HOME%
      cd %WMSAPP_HOME%/bin
      startup.bat

    OS X


    • For Wowza Streaming Engine 4.2.0 and later, open a Terminal window and type:
      [install-dir]/WowzaStreamingEngine/java/bin/java -version
      cat [install-dir]/WowzaMediaServer/bin/setenv.sh  
      cd [install-dir]/bin 
      sudo ./startup.sh
    • For Wowza Streaming Engine 4.1.2 and earlier, open a Terminal window and type:
      which java 
      java -version 
      cat [install-dir]/WowzaMediaServer/bin/setenv.sh 
      cd [install-dir]/bin 
      sudo ./startup.sh

    Linux (Ubuntu/Debian/Fedora)


    • For Wowza Streaming Engine 4.2.0 and later, open a Terminal window and type:
      [install-dir]/WowzaStreamingEngine/java/bin/java -version
      cat [install-dir]/WowzaMediaServer/bin/setenv.sh  
      cd [install-dir]/bin 
      sudo ./startup.sh
    • For Wowza Streaming Engine 4.1.2 and earlier, open a Terminal window and type:
      which java
      java -version
      cat [install-dir]/WowzaMediaServer/bin/setenv.sh
      cd [install-dir]/bin
      sudo ./startup.sh

    Then, for further troubleshooting, post a question to the Wowza Server Administration Forum or Submit a Wowza Streaming Engine Technical Support Ticket. (Technical support is included with all active subscriptions and maintenance and support contracts.) In the support ticket form, be sure to share the Java variables you printed in your detailed problem description.

    Instruct Streaming Engine to use the Java "en" locale

    Wowza Streaming Engine may not start or may not run after starting when the Java environment points to certain locales, such as Turkish. To address this problem, simply instruct Wowza Streaming Engine to run under the "en" locale by editing the VMOption variable in the Tune.xml file.

    1. Open [install-dir]/conf/Tune.xml and find the following line:

      <!-- <VMOption>-Duser.language=en -Duser.country=US -Dfile.encoding=Cp1252</VMOption> -->

    2. Uncomment the line by remove the <!-- from the beginning of the line and the --> from the end of the line, as follows:

      <VMOption>-Duser.language=en -Duser.country=US -Dfile.encoding=Cp1252</VMOption>

    3. Save your changes and restart Wowza Streaming Engine.

    4. Confirm that the settings have taken effect by opening the latest access log at [install-dir]/logs/wowzastreamingengine_access.log.YYYY-MM-DD and looking for following entries:

      INFO server comment - Java Locale[user.language]: en 
      INFO server comment - Java Locale[user.country]: US 
      INFO server comment - Java Locale[user.variant]: 
      INFO server comment - Java Locale[file.encoding]: Cp1252

    Note: In Wowza Media Server software, edit the setenv file instead: Open [install-dir]/bin/setenv.sh (OS X and Linux) or [install-dir]/bin/setenv.bat (Windows) and find the following lines:

    rem Uncomment to force Java to use specific language settings
    rem set JAVA_OPTS=%JAVA_OPTS% -Duser.language=en -Duser.country=US -Dfile.encoding=Cp1252

    Remove the "rem" from the beginning of the second line, as follows:

    rem Uncomment to force Java to use specific language settings
    set JAVA_OPTS=%JAVA_OPTS% -Duser.language=en -Duser.country=US -Dfile.encoding=Cp1252

    Save your changes and restart Wowza Media Server.

    Originally Published: 10-02-2010.
    Updated: For Wowza Streaming Engine 4.2.0 on 06-16-2015.

    If you're having problems or want to discuss this article, post in our forum.