title: VMware ESXi vSphere API using Java
body: <p>I use ESXi 6.0 and I want to use the vSphere API to create a VM .
  <br>
  And I use the example code form <a href="https://sourceforge.net/p/vijava/code/HEAD/tree/trunk/src/com/vmware/vim25/mo/samples/vm/CreateVM.java#l30" rel="nofollow">CreatVM</a>
  <br>
  But it show the exception as following .</p>
  
  <pre><code>Exception in thread "main" java.rmi.RemoteException: VI SDK invoke exception:com.vmware.vim25.RestrictedVersion
  at com.vmware.vim25.ws.WSClient.invoke(WSClient.java:122)
  at com.vmware.vim25.ws.VimStub.createVM_Task(VimStub.java:749)
  at com.vmware.vim25.mo.Folder.createVM_Task(Folder.java:130)
  at com.vmware.vim25.mo.samples.vm.CreateVM.main(CreateVM.java:93)
  </code></pre>
  
  <p>And my java environment is built from this <a href="http://vthinkbeyondvm.com/getting-started-with-vsphere-api-using-java/" rel="nofollow">Getting started with vSphere API using Java</a></p>
  
  <p>How should I fix it ? Thanks for your help !!</p>