I am original by the owner Ms
Problem Analysis:
Recently, I have been studying nutch + hadoop. Deploy a set of officialProgramHowever, due to the inconvenience in debugging, a simple test environment for nutch1.2 is built on the local machine (Windows Server 2003) using cygwin simulation.
According to the configuration scheme, in cygwin, go:
Bin/nutch crawl url.txt-Dir localweb-depth 2-topn 100-threads 2 (Note: parameters can be rewritten as needed) command, cygwin promptJava_home not set.
This prompt indicates that the environment variable of the local Java SDK is not configured. (Because I have been developing Java on the local machine before, I subconsciously open cmd, enter the javac command, and the command can be executed. This shows that my environment variable configuration is correct, but why is no configuration prompted in cygwin? Let's continue to check the problem ).
Right-click my computer and choose Properties> advanced> environment variables to check the environment variables.
Classpath:.; C: \ Program Files \ Java \ jdk1.6.0 _ 24 \ bin (omitted from the rest)
No problem found.
Why?
Then open cygwin, enter env to view the simulation configuration of environment variables, and find important information in path.
As you can see, cygwin simulates all the windows environment variables into its own mode, and some special paths here are parsed Based on directory configurations such as % java_home % and % SystemRoot %.
The root cause of the problem is that when I was doing Java development in the early stage, I didn't set the % java_home % variable when setting the environment variable, but according to some online tutorials, the absolute path is directly written into the classpath and path, which causes cygwin to fail to parse correctly.
Solution:
After finding the problem, add the java_home variable to the Windows environment variable, change the root directory path of the SDK in the original absolute path to % java_home %, and disable cygwin, run the command again, OK, and solve the problem.
If the problem persists, you can add the variable "nutch_java_home" to the environment variable. The value is the same as that of java_home.
Note: After the variable value of java_home, no extra points are allowed.