Install XMLBeans
I hope that this part of the content can solve some problems you have encountered when installing Xmlbeans, even not all. Xmlbeans installation is a bit hard to get, and I think most people will encounter problems when they are installed, and I am no exception.
Xmlbeans (I used 2.0.0-beta1) binary installation package, which also includes BIN, DOCS, LIB and other directories. And you have to set your "path" and "classpath" like installing other Java tools. But after setting, I think 90% of people can't run XMLBeans. Here are some questions to pay attention to and I also hope that the questions you have encountered are listed below (OS: WIN XP SP2):
About your JDK directory. My JDK directory is in the "Program Files" directory. When I run XMLbeans with the "Scomp ..." command, an error message like this appears: 'E: / Program' is neither internal command or external command, nor is an executable program or batch file. This error message reminds me of the payment information when I have installed WebLogic 8.1: Don't stay in your WebLogic path, because it may result in serious errors. Because XMLBeans and WebLogic are developed by BEA. So I moved my JDK directory to the root of my partition. About your "path" environment variable. But when I think I am going to succeed, the truth once again made me disappointment. But when I run "Scomp ...", XMLBeans throws IOException and has such an error message:
Javac 'Is Required on the path.java.io ioException: CreateProcess: C: /Xmlbeans-1.0.2/schemas/javac @c: / docume ~ 1 / alex / locals ~ 1 / temp / javac20992 error = 2nulljava.io .IoException: CreateProcess: C: /Xmlbeans-1.0.2/schemas/javac @c: / docume ~ 1 / alex / locals ~ 1 / temp / javac20992 error = 2
This time I check it out.
Http://wiki.apache.org/xmlbeans/xmlbeansv1faq#scompfindingjavac's FAQ. I follow the suggestions mentioned, but I can't find "java_home" in the SCOMP script (bin directory). Maybe it is for the old version of XMLBeans, the information is not updated. After that, another message in it solves my problem. When the Java program is looking for a Java path, there is priority between JRE and JDK. By default, the former is first found. So I put the JDK directory in the front of the PATH environment variable.
About your "xmlbeans_lib". This is not mentioned in the official installation wizard. I found it in the Scomp script. So I added a new environment variable: XMLBeans_Lib, pointing to my lib directory.
After these three steps, I can now use XMLbeans to process the XML Schema file. In addition, I am wonderful, why bea doesn't make it easy to install it, just like other Java tools, do you want to examine whether others use their tools: P
The upcoming release: XMLBeans Practice - Automated Data Exchange between XML and Java (2): Using XMLBeans