On Windows, run the "Nutella" command in cygwin. The capture command of 2 prompts java_home not set Solution

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.