Java 11 Work-around
Previous versions of the vSphere Management SDK were not compatible with Java 11. See below for the procedure to retrofit Java 11.
The SDK stubs and samples were compiled with JDK 1.7 and are compatible up to JDK 1.9. The latest Java LTS version, JDK 11, discontinued libraries supporting SOAP and JAX-WS. This means that, out of the box, the Web Services SDK is not compatible with JDK 11. To build and run sample code with JDK 11, developers must add missing libraries to the lib folder, as follows.
- Download the standalone
jaxws-ri
libraries from here:https://repo1.maven.org/maven2/com/sun/xml/ws/jaxws-ri/2.3.3/jaxws-ri-2.3.3.zip
- Extract the ZIP into a
jaxws-ri
folder and inside the folder, copy all JARs present in the lib directory. - Paste those JARs into the
lib folder of whichever module of the SDK you want to
run samples from. For example, if you want to build and run samples from the
vsphere-ws
module of the SDK, paste the copied JARs into the vsphere-ws/java/JAXWS/lib/ directory of the SDK. - To compile the sample programs, run build.bat -w on Windows or build.sh -w on Linux.
- To run the sample programs type run.bat or run.sh with appropriate arguments.
The above procedure assumes that you downloaded the vSphere Management SDK for vSphere 7.0 U2. The previous SDK version required two additional steps, as described in the vSphere Management SDK 7.0 U1 Release Notes.