VMware vSphere HTML Client SDK
Eclipse Setup
Eclipse Configuration
SDK Tools Eclipse Plug-in
- Virgo Server Setup
- Mac OS Notes
- Development Tips
This page contains setup instructions specific to the Eclipse
IDE and Spring Tool Suite (STS).
1. Eclipse Configuration
Download the Eclipse version of your choice from eclipse.org
(or the STS version of your choice from Spring Tool Suite)
and install it anywhere on your disk. Eclipse comes in different packages, pick Eclipse IDE for
Java EE Developers, not the smaller package Eclipse IDE for Java Developers.
Eclipse.ini
Before using Eclipse you should edit its Eclipse.ini file to set the Java JDK version and increase memory if
necessary. On Mac OS the .ini file is hidden, right-click on the application icon and select Show
Package Contents, the file is in Contents/MacOS.
Add these 2 lines to tell Eclipse to use your installed JDK. Remove any space before each line!
-vm
C:/<your JAVA_HOME directory>/bin/java.exe
Add or change these VM arguments to increase memory:
-Xmx1024m
-XX:MaxPermSize=512m
See more info in the Eclipse.ini wiki.
Eclipse preferences
Start Eclipse and go to Window > Preferences
- In General you can check "Show
heap status" to display a memory indicator.
- In General/Network Connections
you can setup proxy settings for your location.
- In General/Workspace we recommend
to keep "Build automatically" on, and also turn on "Refresh using native hooks"
in case you edit sources outside Eclipse from time to time.
- In Java/Code Style/Formatter you
should define your code formatting conventions.
- In Java/Installed JREs add the
JDK you had installed earlier and make sure it is the default.
In order to build SDK examples you need to set two VSPHERE_CLIENT_SDK
variables.
Go to Window > Preferences >
General > Workspace > Linked Resources as shown below, and add
a new path variable VSPHERE_CLIENT_SDK pointing to the location of
your html-client-sdk directory.
Go to Window > Preferences >
Java > Build path > Classpath variables as shown below, and add a
path variable VSPHERE_CLIENT_SDK pointing to the location of your
html-client-sdk directory.
2. SDK Tools Eclipse Plug-in
The vSphere HTML Client SDK includes an Eclipse plug-in with various tools to help
your HTML plug-in development, including a wizard to create UI and service plug-in
projects easily.
Before trying to install
new software make sure that Eclipse's Network Connections settings are correct, otherwise the UI
won't be responsive.
If your work location requires a proxy go to Window > Preferences > General > Network Connections
to set it up.
- Go to Help > Install New Software...
- Click Add... to select a new site location
- Click Local... and browse to your html-client-sdk/tools/Eclipse plugin site
directory
- You can name this local site "vSphere Client SDK plugin
site" (you will be able to re-use it later if you install the
versions of the Eclipse plugin at the same place)

- Continue the wizard.
- Click Finish, this starts the Eclipse plugin installation.
- A popup comes up to warn you that this plugin doesn't have a
certificate.
- Finally you are asked to restart Eclipse or STS before you can use the
new plugin.
After you restart Eclipse you can verify that the plugin is
correctly installed:
- Open Help > About Eclipse
- Click on Installation Details
- See "vSphere Web Client SDK Tools" in the list of Installed Software
- Note that you can also uninstall the plugin from this view
- Finally, if you select File >
New > Other... you should see a vSphere Web Client folder
containing the wizard to create new projects:
For more information on how to use this wizard please see the tutorial
doc.
3. Virgo Server setup
This section explains how to install the Eclipse Virgo Tools and use the Virgo server within the
Eclipse IDE.
This is not a requirement but it will improve your development experience.
If you are using an old
Eclipse version (before
Luna 4.4) please see this Eclipse
Virgo Tooling wiki.
- Open Help > Install New
Software... and click Add...
- Add the repository http://download.eclipse.org/virgo/snapshot/tooling
as shown below.
(if the URL is not responding check your
Eclipse proxy settings Window > Preferences > General > Network Connections)
- Select Eclipse Virgo Tools and nothing else
- Follow the installation wizard (you will need to restart Eclipse at the end).
Once you have restarted Eclipse:
- Select the Servers view under Window > Show Views
- Look for the Servers tab in the bottom panel and right
click to create a new server.
- In the new server wizard, select the type Eclipse
RT > Virgo Runtime and click Next.
In the next screen, for the installation directory, select the server directory inside your
SDK folder.
(The message "Valid installation" will popup at the
top once you select the right directory). You can leave the default server name as is.
Virgo Run Configuration
On Mac OS you need to define the environment variable VMWARE_CFG_DIR
in a Virgo Run Configuration as shown below otherwise the server won't start'. See the next section
for more Mac tips.
On Windows, it shouldn't be necessary as long as you defined the environment variable VMWARE_CFG_DIR before starting Eclipse (value is C:/ProgramData/VMware/vCenterServer/cfg/).
Additional Virgo Configuration
Double click on the server instance in the Server view, this
opens an Overview page.
- Check options Start server with -clean option and Tail deploy events into Console
view ..
at the bottom right.
- Remove *.xml from the list under Redeploy Behavior
(so that changes in plugin.xml files trigger hot deployment of the bundle).
4. Mac OS Notes
The Finder hides many files by default, it is easiest to make them all visible using this
command in your terminal window:
defaults write com.apple.Finder AppleShowAllFiles YES
The Eclipse.ini or STS.ini file used to configure startup options is hidden, right-click on the
application icon and select Show Package Contents, the file is in Contents/MacOS.
When starting Virgo under your user account (on the command line or from Eclipse) your plugin
code may not have read/write permissions in local directories being used. The solution is to set the
proper permission for your account. For instance, when saving setting values in the globalview
sample, you will get an error if you haven't set write permission to /var/lib/storage because the
data is saved in /var/lib/storage/globalview.
Environment variables
Environment variables are a little tricky on the Mac.
When using scripts on the command line (Terminal window) the easiest is to set them in your
~/.bash_profile. But you need to start Eclipse from the same terminal window with Open
[PATH-TO-ECLIPSE-APP]
See this
article for other solutions.
However this won't work if you run the Ant build scripts from Eclipse unless you start Eclipse
from the command line which is not always practical.
The recommended solution is to edit the Ant Runtime Preferences, adding the property for
VSPHERE_SDK_HOME as shown below:
Make sure NOT to use quotes around your paths, even if they contain spaces!
5. Development tips
Ant builder
An easy way to compile resource files is to setup an Ant Builder in your Eclipse project
configuration as shown below. It executes the build-resources.xml script each time you build the
project:
More on Virgo Tools
You can take advantage of the Virgo server editor to learn more about the currently installed
bundles and their dependencies. This is a good place to start to verify that all your components
are deployed and have the correct dependencies.
Open the server editor, double-click on the Virgo instance in the Eclipse Server view, select the
Bundle Overview tab and click the yellow button at the top to refresh
the list of bundles. Select any bundle to see its details, including the manifest's content and
the packages imported and exported.

Click the link Show dependency graph for bundle to open the Dependency
tab for the selected bundle. For instance the graph for MyService shows a simple package
dependency with the UI bundle MyPlugin: this was configured in MyPlugin's manifest earlier so
that the client code can reference the interface com.mycompany.myService.MyService.

Clicking on the node MyPlugin reveals all the other dependencies from that bundle (they are the
ones generated by the wizard in the manifest so that MyPlugin can communicate with Java
services).

For more information see the Virgo Guides available through Help > Help Contents.
See also:
Javascript API -
Java API -
FAQ