+

Search Tips   |   Advanced Search

Running a Java thin client application on a server machine

To run a Java thin client application on a machine with WAS installed, use the setupClient command then start the application.

We must install WebSphere Application Server before performing this task.

  1. Set up the Thin application client environment.

    Use the setupCmdLine shell.

      app_server_root\bin\setupCmdLine.bat

    Use the setupCmdLine shell.

      app_server_root/bin/setupCmdLine.sh

    (zos) Use the setupCmdLine shell.

      profile_root/bin/setupCmdLine.sh

    (iseries) Use the setupClient script.

    1. Start the Qshell environment. On the CL command line, run the STRQSH command.

    2. On the Qshell command line, run the following command using the dot (.) operator:

        . app_server_root/bin/setupClient [-profileName profileName]

  2. Run the application client.

    Perform one of the following methods:

    • Run a Java command to call your main class directly.
      "%JAVA_HOME%\bin\java" %WAS_LOGGING%"  -Djava.security.auth.login.config="%USER_INSTALL_ROOT%\properties\wsjaas_client.conf"  -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%WAS_EXT_DIRS%;%WAS_HOME%\plugins;%WAS_HOME%\lib\WMQ\java\lib"  -Djava.naming.provider.url=<an_IIOP_URL_or_a_corbaloc_URL_to_your  application_server_machine_name>
      -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory  -Dserver.root="%WAS_HOME%" "%CLIENTSAS%" "$CLIENTSSL" %USER_INSTALL_PROP%  -classpath "%WAS_CLASSPATH%;<list_of_your_application_jars_and_classes>"  <fully_qualified_class_name_to_run> <your_application_parameters>

    • Enter a command to use the WAS launcher.
      "%JAVA_HOME%\bin\java" %WAS_LOGGING%
      -Djava.security.auth.login.config="%USER_INSTALL_ROOT%\properties\wsjaas_client.conf"
      -classpath "%WAS_CLASSPATH%;<list_of_your_application_jars_and_classes>
      -Djava.ext.dirs="%WAS_EXT_DIRS%;%WAS_HOME%\plugins"
      -Djava.endorsed.dirs="%WAS_ENDORSED_DIRS%
      -Djava.naming.provider.url=iiop://<your_application_server_machine_name>
      -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory   %SERVER_ROOT% %CLIENTSAS% %CLISENTSSL% <fully_qualified_class_name_to_run>

    (zos) Perform one of the following methods:

    • Run a Java command to call your main class directly.
      "$JAVA_HOME/bin/java" $WAS_LOGGING
      -Djava.security.auth.login.config="$USER_INSTALL_ROOT/properties/wsjaas_client.conf"
      -Djava.ext.dirs="$JAVA_HOME/jre/lib/ext:$WAS_EXT_DIRS:$WAS_HOME/plugins: $WAS_HOME/lib/WMQ/java/lib"  -Djava.naming.provider.url=<an_IIOP_URL_or_a_corbaloc_URL_to_your  application_server_machine_name>
      -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory
      -Dserver.root="$WAS_HOME" $USER_INSTALL_PROP "$CLIENTSAS" "$CLIENTSSL"
      -classpath "$WAS_CLASSPATH:<list_of_your_application_jars_and_classes>"
      <fully_qualified_class_name_to_run> <your_application_parameters>
      For more information on IIOP and corbaloc URLs, see Develop applications that use JNDI.

    • Enter a command to use the WAS launcher.
      "$JAVA_HOME/bin/java" $WAS_LOGGING
      -Djava.security.auth.login.config="$USER_INSTALL_ROOT/properties/wsjaas_client.conf"
       "-Dws.ext.dirs=<list_of_your_application_jars_and_classes>
      $WAS_EXT_DIRS:$WAS_USER_DIRS"  -Djava.naming.provider.url=<an_IIOP_URL_or_a_corbaloc_URL_to_your  application_server_machine_name>
      -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory   "-Dserver.root=$WAS_HOME"  "$CLIENTSAS" "$CLIENTSSL" $USER_INSTALL_PROP -classpath "$WAS_CLASSPATH"  com.ibm.ws.bootstrap.WSLauncher  <fully_qualified_class_name_to_run> <your_application_parameters>

    (iseries) Run the following command on a Qshell command line.

      java ${JAVA_FLAGS_EXT} -classpath "$WAS_CLASSPATH:jars_and_classes" -Djava.naming.provider.url=URL class_name app_parm

    When using the WAS launcher, run the following command on a Qshell command line:

      java ${JAVA_FLAGS_EXT} -classpath "$WAS_CLASSPATH:jars_and_classes" -Djava.naming.provider.url=URL com.ibm.ws.bootstrap.WSLauncher class_name app_parm


Related concepts

  • Java thin client


    Related tasks

  • Running a Java thin client application on a client machine
  • Develop a Java thin client application