Smarts SAM: Notif fails to load in Linux environment with "JAVA_HOME is not set" errors; How do I set JAVA_HOME variable correctly?
search cancel

Smarts SAM: Notif fails to load in Linux environment with "JAVA_HOME is not set" errors; How do I set JAVA_HOME variable correctly?

book

Article ID: 303933

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:


How do I set the JAVA_HOME environment variable for the Smarts Service Assurance Manager (Smarts SAM) Notif console in a Linux environment?

Smarts SAM Notif console fails to load in Linux environment
Receive "JAVA_HOME" is not set error when running Smarts SAM Notif in Linux

Smarts SAM Notif console is not loading after Java upgrade

When running Smarts SAM ./NotifGui.sh from command line, errors similar to the following are seen in command line console when the system tries to load the Notif console:  

JAVA_HOME is not set; JRE found at ../../jre
Checking version for ../../jre/bin/java
INFO: os.name: Linux
INFO: Attempting L&F: javax.swing.plaf.metal.MetalLookAndFeel
WARNING: While setting look and feel to [javax.swing.plaf.metal.MetalLookAndFeel]: <basedir>/InCharge/CONSOLE/smarts/jre/lib/i386/xawt/libmawt.so: libXi.so.6: cannot open shared object file: No such file or directory
INFO: Attempting L&F: com.sun.java.swing.plaf.gtk.GTKLookAndFeel
WARNING: While setting look and feel to [com.sun.java.swing.plaf.gtk.GTKLookAndFeel]: Could not initialize class java.awt.Toolkit
INFO: Attempting L&F: com.sun.java.swing.plaf.motif.MotifLookAndFeel
WARNING: While setting look and feel to [com.sun.java.swing.plaf.motif.MotifLookAndFeel]: Could not initialize class java.awt.Color
Exception in thread "main" java.lang.UnsatisfiedLinkError: <basedir>/InCharge/CONSOLE/smarts/jre/lib/i386/xawt/libmawt.so: libXi.so.6: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at sun.security.action.LoadLibraryAction.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
    at sun.awt.DebugHelper.(Unknown Source)
    at java.awt.Component.(Unknown Source)
    at com.netmg.notif.gui.NotifApplication.(NotifApplication.java:34)
    at com.netmg.notif.gui.NotifApplication.main(NotifApplication.java:23)



Environment

VMware Smart Assurance - SMARTS

Cause

The JAVA_HOME environment variable is not set correctly.

Resolution

To set JAVA_HOME correctly for Smarts SAM Notif in a Linux environment:

  1. Login to your account and open .bash_profile file as root.

    $ vi /etc/bash.bashrc
     
  2. Set JAVA_HOME as follows:

    export JAVA_HOME=/usr/java/<JDK version folder>/bin/java
    export PATH=$PATH:/usr/java/<JDK version folder>/bin


     
  3. Save and close the file. To activate the new path settings without rebooting the system, enter either of the following commands:

    source /etc/profile 

    OR

    . /etc/profile