Author: fliggy (http://hi.baidu.com/imlidapeng) All rights reserved. Respect the fruits of others' work. Please indicate the author and original source and this statement when reprinting. In the preceding example, we have successfully configured the vsphere SDK runtime environment and successfully run the SDK. However, to develop a system for managing ESX servers, we also need to configure the development environment of the vsphere SDK. This article describes how to use eclipse to build the vsphere SDK development environment. If the system you developed is based on Apache axis1.4 and Java JDK 1.5, you can directly use these jar files pre-compiled by the VMware SDK in the application without re-generating stub and compiling. To better understand the vsphere SDK, this article builds five projects in eclipse, including vim, vim25, apputil, credstore, and samples for independent development and debugging, it is easy for us to develop and debug our own ESX management system later. 1. Create a project 2. Create a package name and copy the corresponding code.
Project namePackage nameSource location Vmwaresdk_vim com. VMware. Vim \ SDK \ samples \ axis \ Java \ com \ VMware \ Vim Vmwaresdk_vim25 com. VMware. vim25 \ SDK \ samples \ axis \ Java \ com \ VMware \ vim25 Vmwaresdk_appuitls com. VMware. apputils \ SDK \ samples \ axis \ Java \ com \ VMware \ apputils Vmwaresdk_credstore com. VMware. Security. credstore \ SDK \ samples \ axis \ Java \ com \ VMware \ SECURITY \ credstore Vmwaresdk_samples com. VMware. samples \ SDK \ samples \ axis \ Java \ com \ VMware \ Samples |
|
|
|
3. Set Java build path Set the required project in Properties> JAVA build path> projects of each project.
Project name required projects Vmwaresdk_vim none Vmwaresdk_vim25 none Vmwaresdk_appuitls vmwaresdk_vim, vmwaresdk_vim25, vmwaresdk_credstore Vmwaresdk_credstore none Vmwaresdk_samples vmwaresdk_vim, vmwaresdk_vim25, vmwaresdk_credstore, vmwaresdk_appuitls |
|
|
|
In eclipse windows-> preferences, add a user libraries named axis to facilitate subsequent use, as shown in figure
Add the required jar files to each project Properties> JAVA build path> libraries.
Project nameLibraries Vmwaresdk_vim none Vmwaresdk_vim25 none Vmwaresdk_appuitls axis Vmwaresdk_credstore none Vmwaresdk_samples axis, WBEM. jar, mailapi. jar, activation. Jar |
|
|
|
4. Run simpleclient Add a run configuration and enter the relevant information. Replace the URL, username, And Password parameters in program arguments.
Click Run. If you have obtained the information about the ESX Server you are testing, you have successfully configured the development environment of the VMware vsphere Web Services SDK. |