Citrix XenApp

Getting Java web applications to work on Citrix XenApp

on

You might get a request to to publish an Internet Explorer URL/link in XenApp for whatever reason. Web applications that use Java Runtime Environment (JRE)/Java applets do not play nicely with Citrix XenApp. The main problem is the Java cache. It wants to write its cache to:

C:\Program Files\Java\Cache\username\Sun\Java\Deployment\cache

by default during a XenApp session but nothing ever gets populated past the “username” part. The directory underneath will be blank and your web application will never load the Java applet.

I’m not a Java expert and I’m not even going to claim the following is any kind of best practice. But this is what I have done in my environments to make the web apps work using XenApp. If you have a better way of doing it, please do comment in this post.

So a little background, I am using Windows Server 2008 R2 with IE9 with Java (JRE) 6 Update 26 installed because my web app requires that specific version of Java.

1. Go to “C:\WINDOWS\Sun\Java\Deployment” and create a file called “deployment.config” with the following:

deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties

2. Now create a file called “deployment.properties” in the same folder with your custom properties. What I do is generate a deployment file and then copy it over to this directory. To do this, open up Internet Explorer and go to your web app. Once Java is invoked, you will notice the Java icon in the notification bar in the bottom right.

Right click on it > Open Control Panel > Settings and you will see a path where temporary files are kept.

This is the default Java cache and will look like:

C:\Users\username\AppData\LocalLow\Sun\Java\Deployment\cache

Navigate to:

C:\Users\username\AppData\LocalLow\Sun\Java\Deployment\

and there will be a file called “deployment.properties” that was just generated for you. Just copy it over to the “C:\WINDOWS\Sun\Java\Deployment” folder as is.

Now you need to edit this file and specify the Java cache to be somewhere else. In my case, I want it to go to a folder on my D: drive called JavaCache. So all I add is this line (make sure the slashes are just like this, I know it’s a little odd):

deployment.user.cachedir=D\:\\JavaCache

So now my “deployment.properties” file will look like this:

Yours will probably look different than mine depending on which version of JRE you have installed.

3. Make sure to create the location you specified above. It can be a blank folder and will be populated the first time someone invokes Java. So in my case, I created:

D:\JavaCache

4. Now publish IE and the URL like you normally would in the XenApp console. IMPORTANT NOTE: If you are using 32 bit IE and installed 32 bit Java, DO NOT publish 64 bit IE by accident. It will not be able to use the 32 bit Java. You will need to install 64 bit Java if you intend to use 64 bit IE.

Here is an example of how 32 bit IE should be published on Server 2008 R2 in XenApp 6.5:

Command line:
"C:\Program Files (x86)\Internet Explorer\iexplore.exe" "http://www.google.com"

Working directory:
C:\Program Files (x86)\Internet Explorer

5. That’s it, now launch your published IE web app from your desktop via the WI and it should load just fine. Once Java is invoked, verify your Java cache is pointed at the new location. Just look in your notification area for the Java icon, right click on it > Open Control Panel > Settings and you should see “D:\JavaCache“.

One interesting thing to note, older versions of Java pull their deployment configuration from a different location. So if putting everything in:

C:\WINDOWS\Sun\Java\Deployment

does not work for you, try copying them to:

C:\Program Files (x86)\Java\jre6\lib

and everything should work. Just make sure to edit your “deployment.config” accordingly with the new path to “deployment.properties“. An example, I have a web app that requires JRE 6 Update 11 and it pulls the deployment info from the lib folder and completely ignores the one in the Windows folder:

I also want to note that Oracle has pretty good documentation on configuring the deployment configuration file to your liking here:

http://docs.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html

You can do quite a bit of customization to it. Some of my web apps require certain things to be configured in Java such as suppressing certain warning messages and I have used this article to set those switches. For example setting the Java System Cache:

deployment.system.cachedir=D\:\\JavaSystemCache

or Trusted Certs store:

deployment.user.security.trusted.certs=D\:\\JavaCertStore\\security\\trusted.certs
deployment.system.security.trusted.certs=D\:\\JavaCertStore\\security\\trusted.certs

or getting rid of Java warning prompts:

deployment.security.notinca.warning=false
deployment.security.expired.warning=false
deployment.security.mixcode=HIDE_RUN

or even setting Java heap size memory limits:

deployment.javaws.jre.0.args=-Xmx256m -Xms64m
deployment.javapi.jre.0.args=-Xmx256m -Xms64m

where 0 should be the Java version, but it has worked for me without having to specify it in the past. If you do want to put the version it should be like this:

deployment.javaws.jre.1.6.0.args=-Xmx256m -Xms64m
deployment.javapi.jre.1.6.0.args=-Xmx256m -Xms64m

Again, I’m not a Java expert so there may be an easier way of doing this but this is how I have been able to get my Java web apps to work with XenApp. Let me know of your experiences.

About Jason Samuel

Jason Samuel is an Infrastructure Architect in Houston, TX with a primary focus on mobility, virtualization, and cloud technologies from Citrix, Microsoft, & VMware. He also has an extensive background in web architecture and information security. He is certified in several technologies and is 1 of 50 people globally that is a recipient of the prestigious Citrix Technology Professional (CTP) award. He is 1 of 28 people in the world that is an Atlantis Community Expert (ACE). He is a featured author on DABCC which provides the latest IT Community News on Cloud, Data Center, Desktop, Mobility, Security, Storage, & Virtualization. In his spare time Jason enjoys writing how-to articles and evangelizing the technologies he works with.

Recommended for you

16 Comments

  1. [email protected] command tutorials

    January 22, 2012 at 6:27 PM

    Appreciate your work with detailed information. I am looking for java on citrix app
    Keep rocking

  2. Sebastian

    January 26, 2012 at 11:44 AM

    Thank you so much. You saved my day 🙂

  3. Jim

    February 3, 2012 at 4:52 PM

    You came through when our Java web app developer couldn’t. they just dont know the caveats within citrix. That said! GREAT WRITE UP!

  4. Eric

    February 6, 2012 at 10:28 AM

    Does this set the cache location for all users or do you have to do them each individually?

  5. Jason Samuel

    February 6, 2012 at 10:34 AM

    @Eric
    Sets it for all users.

  6. bob

    April 9, 2012 at 1:14 PM

    This also worked for me but I found a much easier solution that also worked in my environment. Not sure if it applies to everyone.

    My initial Java install was done with a Domain Admin account. Win2k8 r2 does some incorrect registry action when this is done from that account.

    I uninstalled, logged in as a Domain User/Local Administrator and installed with that account. Solved all our issues.

  7. Technology Forum

    July 18, 2012 at 2:09 AM

    Thanks for providing each step in detail. Actually i installed citrix plugins, somehow its not working. After reading this i am able to fix the problem.

    Unix and linux forum

  8. Biren Shah

    November 7, 2012 at 8:59 AM

    You Rock! Thank you for making this document available.

  9. Nicolas

    November 8, 2013 at 7:56 AM

    Thank you !

    My contribution :
    Instead of storing the datas (cache, certs) into the D: disk, you may store them into your TS User folder.
    On the AD user configuration, you have mapped this folder with a driver (L: for exemple).

    Thus, your certs will be saved once.

  10. Blair Ensinger

    August 6, 2014 at 8:40 AM

    Great tips for this issue. Also, I found that even if you do not have “Keep temporary files on my computer” check ON, this workaround is still required because the JRE caches some runtime data that it does not advertise.

  11. Salvatore

    August 13, 2014 at 9:49 PM

    Jason, I hope you can shed some light on this.

    We get a blank page when running a web application using applets. (Oracle*Forms 11g)
    But it works fine if the client is on the same network domain as the Citrix server.
    The two client are on the same PC even.

    Any ideas?

  12. vineet tripathi

    September 7, 2014 at 6:20 AM

    have tried to configure above settings but Run Time Parameter is only reflecting under system tab not for user TAB. I am trying this to setup in xenapp6.5. can any one help on this.

  13. pratibha

    May 5, 2015 at 12:10 AM

    Really very nice information.
    However doing so still could not launch my applet application on windows server 2008 which is working fine in windows 7.

  14. Prasanth

    June 2, 2015 at 9:13 PM

    Thanks much for the information posed.

    I have a question. (might be a silly one 🙂 ) but need your comments.
    Can we use the same cache used for all the users? please reply..

  15. Tiphanie

    December 9, 2015 at 5:57 PM

    Salvatore…were you able to find a solution…we are seeing the same issue.

  16. Veday Jain

    November 13, 2016 at 9:25 PM

    Hi. I am experiencing same issue addressed with Java 7 Update 65. However above recipe doesn’t work for me. I also uninstall and reinstall Java using Local Administrator account but no avail. Is anyone can suggest any other way? Also, I like to ask same question again as raised by Prasanth earlier -“Can we use the same cache used for all the users? please reply”

    Thanks
    Veday

Leave a Reply

Your email address will not be published. Required fields are marked *