AppWorx, Dollar Universe and Sysload Community

  • 1.  Pointing Applications Manager to a new version of Java

    Posted Oct 19, 2016 11:09 AM

    Sometimes customers wish to use a different version of java for the application other than that which we install. After installing the new version of java please find the instructions to point our application to it below:

    In a Unix/Linux environment, to simply change the version of Java used by the master or agent, edit the Java home variable found in the $AW_HOME/site/sosite file, rerun the sosite file, and bounce the Agent. Below is the syntax:

    JAVA_HOME=/path/to/java/home/jre;export JAVA_HOME

    running a "java -version" command before and after running the sosite file should return different versions of Java if Java home is different from what is listed in the sosite file. This value should not change if you are upgrading the Agent.

    Windows is odd in the way it handles multiple installs of Java. The agent will try to use the java that is found in:
    C:Windows\System32
    C:Windows\SysWOW64

    The java executables in these 2 directories, in turn, references a java version specified in the registry. If we do not want to use the java in these directories, we can delete the java.exe and javaw.exe from these directories. Java being referenced, will then fall under the PATH environment variable. If you take a look at the user or system's PATH variable, you will see that it is made up of paths separated by semicolons. The first Java Path that is listed in the PATH environment variable, should be the version that the java -version command returns, and the version that the Agent uses.

    Changes to the Path variable needs a log out/in to take effect. Try this out and then run the java -version command.

    If for some reason, you do not want to edit the PATH environment variable, you can edit the PATH variable by adding a variable to the %AW_HOME%\site\sosite.bat file. The sosite.bat file will be called when you start the watchworx service. The variable you add would be the java path that you want the agent to start with, appended to the front of the PATH variable. An example of this variable is below:

    SET PATH=D:\PATH\TO\Java\jre\;%PATH%




  • 2.  Pointing Applications Manager to a new version of Java

    Posted Oct 19, 2016 12:11 PM
    also worth noting that the PATH variable update can be done in an envvar file (user created in the site folder) - if the file exists it's called by sosite each time it's run, but this file won't get overwritten as part of an upgrade

    because sosite can get called numerous times as part of an individual job execution (..on windows at least..) we found it useful to set a switch in the envvar.bat script after the PATH had been updated and then skip any further PATH updates if the switch had already been set in that session