title: Pig without Hadoop on Windows 7
body: <p>I am trying to run PigUnit tests on a Windows 7 machine before running the actual pig script on a Ubuntu cluster and I start to think that my understanding of "<em>withouthadoop</em>" is not correct.</p>
  
  <blockquote>
    <p><strong>Do I need to install <em>Hadoop</em> to locally run a PigUnit test on a Windows 7 machine?</strong></p>
  </blockquote>
  
  <p>I installed:</p>
  
  <ol>
  <li>eclipse Juno &amp; ant</li>
  <li>cygwin</li>
  </ol>
  
  <p>I set up:</p>
  
  <ol>
  <li><code>JAVA_HOME=C:\Program Files\Java\jdk1.6.0_39</code></li>
  <li><code>PIG_HOME=C:\Users\john.doe\Java\eclipse\pig</code></li>
  <li><code>PIG_CLASSPATH=%PIG_HOME%\bin</code></li>
  </ol>
  
  <p>I created using eclipse's Ant builder <code>jar-all</code> and <code>pigunit-jar</code>:</p>
  
  <ol>
  <li><code>pig.jar</code></li>
  <li><code>pig-withouthadoop.jar</code></li>
  <li><code>pigunit.jar</code></li>
  </ol>
  
  <p>Still when I type <code>pig -x local</code> in cygwin I get:</p>
  
  <pre><code>$./pig -x local
  cygpath: can't convert empty path
  Exception in thread "main" java.io.IOException: Error opening job jar: /usr/lib/pig/pig-withouthadoop.jar
      at org.apache.hadoop.util.RunJar.main(RunJar.java:135)
  Caused by: java.io.FileNotFoundException: \usr\lib\pig\pig-withouthadoop.jar (the systen cannot find the given path)
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:127)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:136)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:73)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:133)
  </code></pre>
  
  <p>When I try to run the test from <a href="http://pig.apache.org/docs/r0.10.0/test.html#pigunit" rel="nofollow">http://pig.apache.org/docs/r0.10.0/test.html#pigunit</a> from within eclipse using the option "<em>Run as JUnit</em>", I get:</p>
  
  <pre><code>java.io.IOException
  at org.apache.pig.pigunit.pig.PigServer.registerScript(PigServer.java:62)
  at org.apache.pig.pigunit.PigTest.registerScript(PigTest.java:171)
  at org.apache.pig.pigunit.PigTest.assertOutput(PigTest.java:267)
  at org.apache.pig.pigunit.PigTest.assertOutput(PigTest.java:262)
  at da.utils.pigunit.PigUnitExample.testTop2Queries(PigUnitExample.java:72)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>
  
  <p>I am starting to think that I missed some crucial basic information to run Pig on Windows, I have to say also that I am no experienced user with Windows 7 and cygwin, I come from the Unix world.</p>