Creating a custom Java Component - How to include Java with another App

  • 7014701
  • 05-Mar-2014
  • 05-Mar-2014

Environment

Novell ZENworks Application Virtualization

Situation

A common problem when dealing with application compatibility is deploying applications that require different versions of Java.  The issue is that running two different versions of Java on the same system is not supported.  How do you deploy two applications to the same system when they need different versions of the Java runtime?

Resolution

ZENworks Application Virtualization (ZAV) solves this problem by packaging the necessary Java runtime with the application. This creates a layer of isolation and allows the two applications to run side-by-side with different versions of the Java runtime.

This article describes how to create an isolated Java component that can be included in a ZAV virtual application.

STEP 1: START WITH A CLEAN WINDOWS 7 32-BIT VIRTUAL MACHINE WITH SERVICE PACK 1 AND IE9 OR LATER

When using the snapshot method to virtualize an application, it is important to start with a clean system so that no components are missed during the capture and diff process.  

The snapshot process can be performed on a virtual machine or a physical machine. Typically a virtual machine is used so that the system can easily be reset in case the process needs to be repeated.

There are many options for virtual machine software including VMWare Workstation, Oracle Virtual Box (free) and Microsoft Virtual PC.

STEP 2: SNAPSHOT THE INSTALLATION

  1. Install ZAV Studio
  2. Take a "Before" capture
  3. Save the before snapshot
  4. Install the required Java version
  5. Test the Java version by doing a Java version check via the web
  6. Turn off Java Updates via the Control Panel
  7. Stop any Java services that were started
  8. Take the "Capture and Diff" 

STEP 3: EDIT THE CONFIGURATION

  1. Backup the original configuration file by saving the configuration under a new name
  2. Set the Project type to Component
  3. Set the output file to java-<version>.svm
  4. Go to Settings > Process Configuration > Virtual Services and uncheck "Auto Start"
  5. Set the following folders to Full isolation
    • Windows folder\Sun
    • Program Files\Java
    • Program Files\Common\Java
  6. Set the following registry keys to Full isolation (create key if it does not exist)
    • Current user root\Software\Classes
    • Current user root\Software\Classes\CLSID
    • Current user root\Software\Classes\JavaPlugin.<version>
    • Local machine root\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects
  7. Go to Settings > Properties and uncheck "Inherit properties" and put in meta data for the Component
    • This is used to distinguish the component when importing into other projects.

java-properties.PNG

 

STEP 4: BUILD AND TEST THE COMPONENT

The easiest way to test the component is to build a virtual version of Internet Explorer and import the Java component under the Components section.

Run the virtual Internet Explorer with the Java component included and verify the Java version via the web.