Specify a different Java location for your application

If your default environment does not point to the correct JRE, add the directory that contains the Java binary to the PATH environment variable in the Service section of the application profile. This adds the directory you specify to the beginning of your existing PATH environment variable.

In cases where you cannot guarantee that the PATH environment variable on a compute host:

  • Includes a Java bin directory

  • Has the path to the Java bin directory for the Java version you want to use

You can configure your System PATH to point to the correct Java version, or set the path to the correct version of Java in the application profile.

Note:

If you change the configuration of your system path environment, you must restart Symphony or Symphony DE.

If you set it in your application profile, the directory you specify is added to the beginning of your existing PATH environment variable.

Note:

If you set the Java bin path in your application profile, all compute hosts must have Java installed in the same location. If Java is not installed at that location, the system uses the next Java location in the Path, if any.

  1. Open the application profile for your application.

    For example, on Linux:

    $SOAM_HOME/5.1/samples/Java/SampleApp/SampleAppJava.xml

    For example, on Windows:

    %SOAM_HOME%\5.1\samples\Java\SampleApp\SampleAppJava.xml

  2. In the Service, osTypes, osType section, change the PATH environment variable to point to the correct Java version.
     <Service description="The Sample Service" name="sampleService">
            <osTypes>
              <osType name="LINUX86" startCmd="${SOAM_DEPLOY_DIR}/Runcom.platform.symphony.samples.SampleApp.service.MyService.sh" workDir="${SOAM_HOME}/work">
              <env name="PATH">/usr/bin/jdk1.5.0_04_x86/bin</env>
             </osType>
              <osType name="NTX86" startCmd="cmd.exe /c cmd.exe /c ${SOAM_DEPLOY_DIR}/Runcom.platform.symphony.samples.SampleApp.service.MyService.bat" workDir="${SOAM_HOME}/work"5.1>
              <env name="PATH">c:\java\jdk1.5.0_04_x86\bin</env>
             </osType>
            </osTypes>
    </Service>
  3. Save the file.
  4. Update your application profile with the Platform Management Console or the soamreg command.

    For example, on Linux:

    soamreg $SOAM_HOME/5.1/samples/Java/SampleApp/SampleAppJava.xml

    For example, on Windows:

    soamreg %SOAM_HOME%\5.1\samples\Java\SampleApp\SampleAppJava.xml