For a J2EE application client application and or Thin application client application to be launched using Java Web Start (JWS), an Java Runtime Environment that IBM provides, the library JAR files and properties files bundled in Application Client for WebSphere Application Server must be installed in the JWS. This article provides the steps to build the Application Client run-time dependency component from an Application Client installation. It is packaged as a Web Archive Resource (WAR) file that can be installed in an Application Server.
Before you begin
Install the Application Client for WebSphere Application Server for the platform to which the client application deploys. If there is a requirement to deploy the client application to multiple platforms, the Application Client run-time dependency component must be built separately for each platform that client application supports.For example, if the client application deploys to both the Windows platform and Linux platform, follows the steps for this task to build the Application Client run-time dependency component for Windows on a Windows platform machine with the Application Client for WebSphere Application Server for Windows installed. Now, repeat the steps for this task to build the Application Client run-time dependency component for Linux on a Linux platform machine with the Application Client for WebSphere Application Server for Linux installed.
Steps for this task
CD C:\Program files\IBM\WebSphere\AppClient\bin
buildClientRuntime C:\WebApp1\runtime\WASClient6.0_windows.jar
buildClientRuntime C:\WebApp1\runtime\WASClient6.0_windows.jar buildThin
copy ..\JWS\WebSphereClientRuntimeInstaller.jar C:\WebApp1\runtime
cd C:\WebApp1\runtime jarsigner -keystore myKeystore -storepass myPassword WASClient6.0_windows.jar myKeyAliasName jarsigner -keystore myKeystore -storepass myPassword WebSphereClientRuntimeInstaller.jar myKeyAliasName
jarsigner -J"-Xmx256m" -keystore myKeystore -storepass myPassword WebSphereClientRuntimeInstaller.jar myKeyAliasName
Result
Your Web application is ready to serve the Application Client run time and the JRE environment.Example
<%--
This is an Installer JNLP
It will download two .jars:
WebSphereClientRuntimeInstaller.jar - includes the installer utility
WASClient6.0_<platform>.jar - the client runtime JRE image
The installer will unzip the client runtime jar on the client machine, and register
it with Java Web Start
--%>
<%! private final String description="WebSphere Client 6.0 Runtime JRE";
// The version here is (WAS based) JRE version - as to be managed on the client
private final String JREversion="WASclient6.0";%>
<%
// locally declared variable
String url=request.getRequestURL().toString();
String jnlpCodeBase=url.substring(0,url.lastIndexOf('/'));
String jnlpRefURL=url.substring(url.lastIndexOf('/')+1,url.length());
// Need to set a JNLP mime type - if Web Start is installed on the client,
// this header will induce the browser to drive the Web Start Client
response.setContentType("application/x-java-jnlp-file"); 1
response.setHeader("Cache-Control", null);
response.setHeader("Set-Cookie", null);
response.setHeader("Vary", null);
// An installer must reply with the version number for a given install
if (response.containsHeader("x-java-jnlp-version-id"))
response.setHeader("x-java-jnlp-version-id", JREversion); 2
else
response.addHeader("x-java-jnlp-version-id", JREversion);
%>
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for <%=description %> -->
<jnlp
spec="1.0+" <%--
Automate the code base response --%>
codebase="<%=jnlpCodeBase%>"
href="<%=jnlpRefURL%>">
<information>
<title><%=description%></title>
<vendor>IBM</vendor>
<icon href="icon.gif">
<description><%=description%></description>
<description kind="short"><%=description></description>
<description kind="tooltip"><%=description></description
<offline-allowed/>
</information>
<security>
</all-permissions>
</security>
<resources>
<j2se version="1.4+"/><%-- The installer can use any 1.4 JRE --%> 3
<jar href="WebSphereClientRuntimeInstaller.jar" main="true"/> 4
<%-- JRE version registration with Web Start --%>
<property name="com.ibm.websphere.client.jre.version" value="<%=JREversion%>"/> 5
</resources>
<resources os="Windows"> 6
<jar href="windows/WASClient6.0_windows.jar"/> 7
<%-- relative path of the jre executable --%>
<property name="com.ibm.websphere.client.jre.launch.java"
value="java\jre\bin\java.exe"/> 8
<resources os="Linux">
<jar href="linux/WASClient6.0_linux.jar"/>
<property name="com.ibm.websphere.client.jre.launch.java" value="java/jre/bin/java"/>
</resources>
<installer-desc />
</jnlp>
Related concepts
Web applications
Related tasks
Preparing Application Clients run-time library component for Java Web
Start