---
title: "problems in building hadoop "
author: "standalone"
date: "2010-12-22T10:28:04Z"
tags: []
categories: ["开源软件"]
slug: "problems-in-building-hadoop"
draft: false
lastmod: "2012-10-26T11:19:42Z"
id: 849001
url: "https://standalone.iteye.com/blog/849001"
---

When I try to modify some code in ASF hadoop-0.20.2 and compile it with command "ant jar".

It reports no \*route to host* exceptions.

 

I do this on a server that with no direct internet connection, that is, I need to set a proxy to access outside network.

 

So to build hadoop, maven needs to download something from maven repository, so you need to set proxy for it and also a proxy for ant.

 

ant proxy:

 

ANT\_OPTS="-Dhttp.proxyHost=host -Dhttp.proxyPort=yourport"

 

maven proxy:

 

&lt;settings&gt;  
  &lt;proxies&gt;  
    &lt;proxy&gt;  
       &lt;active&gt;true&lt;/active&gt;  
       &lt;protocol&gt;http&lt;/protocol&gt;  
       &lt;host&gt;your proxyHost&lt;/host&gt;  
       &lt;port&gt;your port&lt;/port&gt;  
    &lt;/proxy&gt;  
   &lt;/proxies&gt;  
&lt;/settings&gt;

 

Now it works well. Hope this can be useful to you.