Windows Setup
On Windows, do the following:
- Right-click My Computer, then click Properties.
- On the Advanced tab, click Environment Variables.
- Add an XMLBEANS_HOME variable whose value is the XMLBeans location.
For example, if you downloaded the XMLBeans release to the root of your C drive, this might be c:\xmlbeans-1.0.2.
- Edit the PATH variable so that it includes the bin directory of your XMLBeans installation. For the XMLBeans release, you could add %XMLBEANS_HOME%\bin.
- Edit the CLASSPATH variable to include the xbean.jar included with XMLBeans.
This is located in the lib directory. If you built XMLBeans from source, you can also use the JAR file in the build/ar or build/lib directories.
- For XMLBeans V2, also include the jsr173_1.0_api.jar (or jsr173_api.jar, whichever one came in your download) to the CLASSPATH variable.
This is found in the lib (or build/lib if you built XMLBeans from source) directory.
UNIX/Linux Setup
On UNIX/Linux, update your environment as follows:
- export XMLBEANS_HOME=<location of XMLBeans root>
- export PATH=$PATH:$XMLBEANS_HOME/bin
- export CLASSPATH=$XMLBEANS_HOME/lib/xbean.jar:$CLASSPATH
(or, if you built XMLBeans from source, export CLASSPATH=$XMLBEANS_HOME/build/lib/xbean.jar:$CLASSPATH)
- For XMLBeans V2, export CLASSPATH=$CLASSPATH:$XMLBEANS_HOME/lib/jsr173[_1.0]_api.jar
(or, if you built XMLBeans from source, export CLASSPATH=$CLASSPATH:$XMLBEANS_HOME/build/lib/jsr173[_1.0]_api.jar)
Your updates might look like this:
export XMLBEANS_HOME=/home/me/xmlbeans-2.1.0 export PATH=$PATH:$XMLBEANS_HOME/bin export CLASSPATH=$XMLBEANS_HOME/lib/xbean.jar:$XMLBEANS_HOME/lib/jsr173_1.0_api.jar:$CLASSPATH
Once you've updated your environment paths, you should be set up to use the tools that come with XMLBeans. These include a schema compiler, an instance validator, and more.