Properly Streaming a Java or JNLP Application (Java client / Deployment settings in enterprise environment) – part 3

26 06 2013

After a long hiatus from this blog and being busy busy busy in other projects it’s time to complete this guide,
Part 1: JNLP Applets and Application streaming
Part 2:

Beginning from the a certain JRE version options became available for the JNLP cache to be either in USER or SYSTEM context,
This provides a huge advantage for us administrators to deliver an application on a System context on machines, such as XenApp Servers, Multi-User workstations and of course streamed environment.
Please note: I will refer to Citrix Application Streaming version but the principles apply to other virtualization technologies.

Let’s get on with it, what we want to do is instead of having the user go in to the application and have the JNLP cached to the user context we will want to either set rules for the caching in the JRE or pre-cache it for them on a SYSTEM context and have it available for all users on that machine.

We can do that by using the following JRE tools:

deployment.config – this file when placed in a certain location can pre-determine the configuration of the JRE environment
Location: C:\Windows\Sun\Java\Deployment
deployment.system.config.mandatory=True – this file when placed in a certain location can pre-determine the cache folder location
Location: C:\Windows\Sun\Java\Deployment
#Wed Aug 15 22:05:15 IDT 2012
deployment.browser.path=C\:\\Program Files (x86)\\Internet Explorer\\iexplore.exe
#Java Deployment jre's
#Wed Aug 15 22:05:15 IDT 2012
deployment.javaws.jre.0.path=C\:\\Program Files (x86)\\Java\\jre7\\bin\\javaw.exe
deployment.javaws.jre.1.path=C\:\\Program Files (x86)\\Java\\jre6\\bin\\javaw.exe

in the code above i have 2 versions of JRE installed and it is found in every user’s profile.
all i did was copy the file and appending it with these 2 parameters:


Then I create the folder C:\Java_System_cache

The next steps are:
running javaws.exe which is the client for JNLP applets the way i want depending on what i need, if i need to profile an application for streaming i will do:
javaws -import -system <url to jnlp>
javaws -import -system -silent <url to jnlp>
both the above cache the jnlp to system cache i pre-configured earlier
i can then do javaws -system <url to jnlp> as the command line for the streamed application to launch the app from the cache,
there’s also -offline switch which might be handy in some situations.

When i profile the applet i will perform installation of the JRE i need so everything will be recorded, create and specify the java folders, properties files and config files, import the applet and save that for later virtualization.

if i wanted to do it on a workstation / XenApp without virtualizing i would just place the config / property files, configure the java cache locations, import the JNLP and set the published application command line to be in the lines of:

javaws -system <url to jnlp>

and that’s that!

wait, wait, wait, in the last part i mentioned it’s handy for upgrades of applets, yeah it is, if the vendor requires me to clear the cache i can do it for the SYSTEM cache using the parameters like:
javaws -uninstall <url to jnlp>
javaws -clearcache (to completely clear the cache)

Voila! hope this helps all you administrators out there who want to keep IT clean with those Java based applications.