First, configure the Java JDK environment and ant environment.
JDK environment Configuration:
Create the environment variable java_home = c: \ Program Files \ Java \ jdk1.6.0 _ 10 and add % java_home % \ bin to the environment variable path. In this way, you can.
Ant environment Configuration:
Assume that the directory decompressed by ant is c: \ apache-ant-1.8.2. Add Environment Variables
Ant_home = c: \ apache-ant-1.8.2, and add % ant_home % \ bin in path.
Test whether JDK and ant are configured successfully:
Enter Java-version and ant-version in the doscommand line to check whether the output is correct.
Step 2: assume that the decompressed directory in the book is c: \ iweb2. Open the doscommand environment (START-> Run, Enter cmd ).
Go to the C: \ iweb2 \ build directory (cd c: \ iweb2 \ build ).
Enter set classpath = enter in the command line to clear the classpath. Enter ant in the command line and press Enter.
Step 3: Enter c: \ iweb2 \ deploy \ bin. Enter BSc. BAT and press enter to obtain the result of building success. This indicates that the configuration is successful.
About booksCode. Create an iweb2_home environment variable in the system environment with the value c: \ iweb2.
In the Java environment, I use system. getenv ("iweb2_home"); the result is c: \ iweb2. But the code in the book: system. getproperty ("iweb2.home"); and using system. getenv ("iweb2_home") in the input; the result is null. I don't know why.
In order to run the code in the book, I changed the code system. getproperty ("iweb2.home") in the book to "C: \ iweb2", so that the code in the book can be run.