6.0

Table Of Contents
VMware, Inc. 13
Chapter 2 Setting Up for Java Development
Import Server Certificates into the Java Keystore
Import server certificates if you plan to use the HTTPS protocol and if you do not plan to use the
--ignorecert command-line argument.
To use HTTP, rather than HTTPS, and avoid the use of certificates entirely, follow the procedure detailed in
“Modifying Server Configurations to Support HTTP” on page 27. However, using HTTPS provides better
security for production environments.
The JAVAHOME environment variable must be set and added to the PATH environment variable. The
certificate for each target server must be located in the C:\VMware-Certs subdirectory. See “Obtaining Server
Certificates” on page 26.
To import certificates into a local Java keystore
1 Open the Windows command prompt or Linux shell command.
2 Create the directory for the Java certificate store.
Create the directory only. The actual keystore file, vmware.keystore, is created during the process of
importing the certificates.
3 Navigate to the directory.
For example, on Windows use the following directory:
cd vmware-certs\vmware
4Use the Java keytool utility to import a certificate.
The syntax is as follows:
keytool
-import -trustcacerts -alias
server-name
-file
certificate-filename
-keystore
keystore-name
For example:
C:\VMware-Certs>keytool -import -trustcacerts -alias root -file root.cer -keystore keystore.jks
A prompt requesting a password for the keystore appears:
Enter keystore password:
Table 2-1. Batch Files and Shell Scripts for Java
Filename Description Usage note
build.bat
build.sh
Checks for environment variable JAVAHOME and sets PATH,
using the JAVAHOME variable. Cleans up existing Java files
(by calling clean.bat or clean.sh). build.bat sets the
local classpath (by calling lcp.bat). Creates the
vim25.jar, and samples.jar files.
Use this script to generate client stubs
and rebuild all sample applications. Use
the -w flag to recompile without
regenerating stubs.
lcp.bat Sets the local classpath on the workstation. Called by
build.bat and by run.bat.
Optional. Use to set local classpath.
run.bat
run.sh
Batch file that enables running any of the sample
applications. Sets the Java trustStore property to the local
trust store and invokes the Java runtime with the name of
the application passed as a parameter.
Use this script to run any Java sample
applications.
clean.bat Removes any existing artifacts before building the
samples, deleting Java class files in the samples packages
and samples.jar file. Called by build script.
Optional. Deletes all generated source
code files.
Operating System Path
Windows C:\VMware-Certs\vmware.keystore
Linux ~/vmware-certs/vmware.keystore